0% found this document useful (0 votes)
11 views10 pages

Algorithm-Flowchart Riego

The document contains a series of algorithms and flowcharts for various mathematical operations and calculations, including displaying messages, performing arithmetic operations, and calculating grades and geometric properties. Each algorithm is structured with steps that outline the process from start to end, detailing inputs, calculations, and outputs. The algorithms cover basic operations such as addition, subtraction, multiplication, division, and more complex calculations like total grades and area/perimeter of a rectangle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views10 pages

Algorithm-Flowchart Riego

The document contains a series of algorithms and flowcharts for various mathematical operations and calculations, including displaying messages, performing arithmetic operations, and calculating grades and geometric properties. Each algorithm is structured with steps that outline the process from start to end, detailing inputs, calculations, and outputs. The algorithms cover basic operations such as addition, subtraction, multiplication, division, and more complex calculations like total grades and area/perimeter of a rectangle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Name: Andrea Shannielle S.

Riego

BSCE-2A

1.Algorithms

STEP 1: Start

STEP 2: Display “Hello”

Display “Andrea Riego”

STEP 3: End

Flowchart

START

Display “Hello”
Display “Andrea Riego

END
2. Algorithms

STEP 1: Start

STEP 2: Declare two numbers as num1 and num2

STEP 3: Input num1, and num2

STEP 4: Print the sum.

STEP 5: End

Flowchart

START

Int num1, num2,


sum

sum = num1 + num2

Print sum

END
3. Algorithms

Step 1: Start

Step 2: Declare two numbers as num1, num2, quotient=0

Step 3: Input num1, and num2

Step 4: Print quotient

Step 5: End

Flowchart

START

Int num1, num2,


qoutient

Quotient= num1/num2

Display quotient

END
4. Algorithms

Step 1: Start

Step 2: Declare a, b, c, d

Step 3: Calculate a = -5+8 * 6, b = (55+9) % 9, c = 20 + -3*5 /8, d = 5+15 / 3 *2 -8 %3

Step 4: Print the result of a; b; c; d

Step 5: End

Flowchart

START

Int a; b; c; d;

a = -5 + (8 * 6)

b = (55 + 9) % 9

c = 20 + ((-3 * 5) / 8)

d = 5 + ((15 / 3) * 2) - (8 %
)

Print result of a; b; c; d;

END
5. Algorithms

Step 1: Start

Step 2: Declare two numbers as num1 and num2, product.

Step 3: Input num1 and num2.

Step 4: Calculate the product of the two numbers.

Step 5: Display the product of two numbers

Step 6: End

Flowchart

START

Int num1, num2,


prod=0

Input num1; Input num2;

Product = num1 * num2

Print “product”

END
6. Algorithms

Step 1: Start

Step 2: Declare num 1 and num 2, sum (addition), multiplication, subtraction, division
and remainder.

Step 3: Input num 1 and num 2

Step 4: sum = num1 + num2; diff = num1 – num2; prod = num1*num2; quotient =
num1/num2; % = num1 mod num2;

Step 5: Display the result of num 1 % num 2.

Step 6: End

Flowchart

START

Int num1 = 125; num2 = 24; sum = 0; diff = 0; prod = 0; qout = 0; % = 0

Input num 1; Input num 2;

sum = num1 + num2;


diff = num1 – num2;
prod = num1*num2;
quotient = num/num2;
% = num1 mod num2;

print num1 “+” num2 “=”sum;


print num1 “-“ num2 “=”diff;
print num1 “*” num2 “=” prod;
print num1 “/” num2 “=” quotient;
print num1 “mod” num2 “=” %

END
7. Algorithms
A. sum B. difference C. product D. quotient
Step 1: Start
Step 2: Declare num1; num2; operator
Step 3: Input num1; input num2; input operator;
Step 4: Calculate the result = num1 + num2.
Step 6: Calculate result = num1 – num2.
Step 8: Calculate the result = num1 / num2.
Step 10: Calculate the quotient result = num1 * num2.
Step 11: Display “result’
Step 12: End

START

Int num1; num2;

Input num1; input num2; input

True
Operator = + result = num1 +

False
True

Operator = - result = num1 – num2.

False

True
Operator = / result = num1 / num2.

False True
Operator = * result = num1 * Display
False “result”

Display Error
END
8. Algorithms

Step 1: Start

Step 2: Declare assignment score; assignment result; seatwork score; seatwork result;
quiz score; quiz result; exam score; exam result;
Step 3: Input assign score, input assign item;
Input seatwork score, input seatwork item;
Input quiz score, input quiz item;
Input exam score, input exam item;
Step 4: Calculate total grade of student: assign= assign score/ assign item*100;
seatwork= seatwork score/ seatwork item* 100; quiz result= quiz score/ quiz item*100;
exam result= exam score/ exam item* 100;
Step 5: Total grade = 0.10* assign result + 0.20* seatwork result + 0.30* quiz result +
0.40* exam result;
Step 5: Display the final grade.
Step 6: End

START

Int assignment score; assignment result; seatwork


score; seatwork result; quiz score; quiz result; exam
score; exam result;

Input assign score, input assign item; Input


seatwork score, input seatwork item; Input
quiz score, input quiz item; Input exam
score, input exam item;

Calculate total grade of student: assign= assign score/ assign


item*100; seatwork= seatwork score/ seatwork item* 100; quiz
result= quiz score/ quiz item*100; exam result= exam score/
exam item* 100; Total grade = 0.10* assign result + 0.20*
seatwork result + 0.30* quiz result + 0.40* exam result;

Display “Total Grade”

END
9. Algorithms

Step 1: Start
Step 2: Declare dollar value exchange rate to peso is 56.00;
Step 3: Input dollar
Step 4: Peso = dollars * exchange rate (exchange rate is 56.00).
Step 5: Print the equivalent peso value.
Step 6: End.
Flowchart

START

Int dollar value exchange


rate in peso= 56.00;

Input dollar

peso = dollars * exchange rate

Print “peso” value

END
10. Algorithms
Step 1: Start
Step 2: Declare length and width of a rectangle
Step 3: Input length and width of rectangle.
Step 4: Calculate the area of the rectangle as area = length * width.
Step 5: Calculate the perimeter of the rectangle as perimeter = 2 * (length + width).
Step 6: Display the area and perimeter.
Step 6: End.
Flowchart

START

Int length and width of


the rectangle; area;
perimeter;

Input length and width of


rectangle.

Calculate the area of the rectangle as area = length * width

Calculate the perimeter of the rectangle as perimeter = 2 * (length +

Display the area and perimeter.

END

You might also like