Write an algorithm and draw the flowchart of finding the area and perimeter of a circle. The
radius (float) need to be entered by the user and if the user enters negative radius or zero radius,
the algorithm will ask the user to be entered again. (The algorithm will ask the user to enter the
radius until it is entered as positive.) At the end, the algorithm will find and print area and
perimeter of the circle as output.

Respuesta :

Answer:

The algorithm

Step 1: Start

Step 2: Input Radius

Step 3: While Radius < = 0

                 Input Radius

Step 4: Pi = 3.14

Step 5: Perimeter = 2 * Pi * Radius

Step 6: Area = Pi * r^2

Step 7: Print Area, Perimeter

Step 8: Stop

Explanation:

This indicates the start of the algorithm

Step 1: Start

This inputs the radius

Step 2: Input Radius

The following loop is repeated until user input for radius is greater than 0

Step 3: While Radius < = 0

                 Input Radius

This initializes Pi to 3.14

Step 4: Pi = 3.14

This calculates the Perimeter or Circumference

Step 5: Perimeter = 2 * Pi * Radius

This calculates the Area

Step 6: Area = Pi * r^2

This prints the calculated Perimeter ad Area

Step 7: Print Area, Perimeter

This indicates the end of the algorithm

Step 8: Stop

I've added the flowchart as an attachment

Ver imagen MrRoyal
ACCESS MORE