You are on page 1of 1

ASSIGNMENT #2 - Algorithms and Flowcharts

1. Write an algorithm and construct a flowchart that will compute and display the
area and perimeter of the shapes listed below.
a. Rectangle - given as user inputs the length and width.
b. Square - given as user input the side.
c. Circle - given as user input the radius. The perimeter of a circle is just its
circumference.
(Hint: Make sure to use the correct formulas.)

2. Write an algorithm and construct a flowchart that will convert an input


temperature in Celsius to its equivalent measure in Fahrenheit and output the
Fahrenheit. (Hint: Make sure to use the correct formulas.)

3. Write an algorithm and construct a flowchart that will convert an input


temperature in Fahrenheit to its equivalent measure in Celsius and output the
Celsius. (Hint: Make sure to use the correct formulas.)

Selection (If-then-else statement):


4. Write an algorithm and construct a flowchart that will accept as input a student’s
name, exam score and total points. Compute the exam grade using the formula:
examGrade = (score/total points) * 100. The passing grade or percentage is 70%.
Determine if the student passed or failed the exam. Display or output the
student’s name, exam score, total points, grade and a remark “Passed” or
“Failed”.

Repetition/Looping(While statement):
5. Write an algorithm and construct a flowchart that accepts a positive integer n and
use a while loop structure to compute for the product of sums from 1 to n using a
while loop structure and after computation, output the productOfSums.
Hint: if input n=5 then prodOfSums = (1+1) x (2+2) x (3+3) x (4+4) x (5+5) = 3840

6. Write an algorithm and construct a flowchart that computes the area and
circumference of a circle five (5) times using a while loop structure. For each time,
get radius R as a user input, compute the Area and Circumference, and output the
values of R, Area and Circumference.
Hint: Area = pi * R * R, Circumference = 2 * pi * R, where pi = 3.1416.

You might also like