Algorithm-Flowchart Riego
Algorithm-Flowchart Riego
Riego
BSCE-2A
1.Algorithms
STEP 1: Start
STEP 3: End
Flowchart
START
Display “Hello”
Display “Andrea Riego
END
2. Algorithms
STEP 1: Start
STEP 5: End
Flowchart
START
Print sum
END
3. Algorithms
Step 1: Start
Step 5: End
Flowchart
START
Quotient= num1/num2
Display quotient
END
4. Algorithms
Step 1: Start
Step 2: Declare 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 6: End
Flowchart
START
Print “product”
END
6. Algorithms
Step 1: Start
Step 2: Declare num 1 and num 2, sum (addition), multiplication, subtraction, division
and remainder.
Step 4: sum = num1 + num2; diff = num1 – num2; prod = num1*num2; quotient =
num1/num2; % = num1 mod num2;
Step 6: End
Flowchart
START
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
True
Operator = + result = num1 +
False
True
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
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
Input dollar
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
END