An example of the algorithm description section calculates the area of the circle:
Description:
1. Read radius
2. Calculate area = radius * radius * PHI
3. Show broad to the screen
4. Finish
1. Read radius
2. Calculate area = radius * radius * PHI
3. Show broad to the screen
4. Finish
An example algorithm calculates the area of a circle written using a complete descriptive sentence:
Algorithm Area Circles
{Calculate the area of the circle for the size of a specific radius.
The algorithm receives the input of the radius of the circle, calculating
extent, then print the extent to the output device}
Declaration:
Radius = real {data type of fractional}
area = real {data type of fraction}
PHI = 3.14
Description:
1. Read radius
2. Calculate area = PHI * radius * radius
Show wide to the screen
4. Done
{Calculate the area of the circle for the size of a specific radius.
The algorithm receives the input of the radius of the circle, calculating
extent, then print the extent to the output device}
Declaration:
Radius = real {data type of fractional}
area = real {data type of fraction}
PHI = 3.14
Description:
1. Read radius
2. Calculate area = PHI * radius * radius
Show wide to the screen
4. Done
Similarly this article.
Sorry if there is a wrong word.
The end of word wassalamualaikum wr. wb
Referensi :
- Ebook Logical and Algorithm
Jika ingin bertanya secara privat, Silahkan hubungi no 085709994443 dan untuk berkomentar silahkan klick link di bawah ini 👇