0% found this document useful (0 votes)
12 views

Coding 101

The document provides flowcharts for calculating the area and perimeter of a rectangle, and the area and circumference of a circle. The rectangle flowchart shows steps to input length and width, calculate area as length x width and perimeter as 2x + 2y. The circle flowchart shows steps to input radius, calculate area as πr^2 and circumference as 2πr. Both flowcharts conclude by printing the calculated values.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Coding 101

The document provides flowcharts for calculating the area and perimeter of a rectangle, and the area and circumference of a circle. The rectangle flowchart shows steps to input length and width, calculate area as length x width and perimeter as 2x + 2y. The circle flowchart shows steps to input radius, calculate area as πr^2 and circumference as 2πr. Both flowcharts conclude by printing the calculated values.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1.

A: Area of and Perimeter of a Rectangle Flowchart

Algorithm: START
Step1: Start

Step2 : Initialize x, y. area and perimeter to be 0

Step3: Read or input the value for x X=0,y=0, area,


perimeter
Step4: Read or input the value for y

Step5: Compute the area by multiplying x and y.

area x*y Read (x);

Step6: Compute the perimeter by adding 2x and 2y.

perimeter 2x + 2y
Read (y);
Step7: Print the computed value of area and perimeter.

Step8: End
area= x*y;

perimeter = 2*x+2*y;

Print (area,
perimeter);

END
Q1.B. Area and circumference of a Circle Flowchart

r = 3.14

Algorithm: START
Step1: Start

Step2 : Initialize r. area and circumference to be 0

Step3: Read or input the value for r r=0 area,


circumference;
Step4: Compute the area by multiplying 3.14∧r 2.

area 3.14 * r2

Step5: Compute the circumference by multiplying 2, 3.14 , and r. Read (r);


circumference 2 * 3.14 * r

Step6: Print the computed value of area and circumference.


area= 3.14*r2;
Step8: End
circumference= 2*3.14*r;

Print (area,
circumference);

END

You might also like