Premise:
The
problem above unlike others will read some other values with itself. in
the other the word some value are constant and you have to make the
algorithm to be aware of this kind of constant and read the value
instead of requesting for it. The constants here is Pi which have the
value 22/7 ~ 3.142 and 2.
Solution:
Major Step
1. Request Data
2. Calculate Data
3. Display Results (Circumference, Area of the circle)
Stepwise Refinement
1. Request Data
1.1 Request radius
2. Calculate Data
2.1 Circumference = 2 * Pi * radius
2.2 Area = Pi * radius * radius
3. Display Result
3.1 Display Circumference
3.2 Display Area
1. Request Data
2. Calculate Data
3. Display Results (Circumference, Area of the circle)
Stepwise Refinement
1. Request Data
1.1 Request radius
2. Calculate Data
2.1 Circumference = 2 * Pi * radius
2.2 Area = Pi * radius * radius
3. Display Result
3.1 Display Circumference
3.2 Display Area
SHARE THIS POST WITH YOUR FRIENDS...::
Tweet
0 comments:
Leave a Reply