Algorithms In Narrative Form

An algorithm in narrative form is not written in discrete steps.   It is expressed as directions in paragraph form and instructions on how rules should be followed.

An algorithm in narrative form can be considered a precursor to pseudocode or a flowchart

Example

An example is given below for the given problem statement

Problem Definition: A solution is needed which finds the circumference of a circle.

Algorithm in narrative form: Prompt the user to enter a non-negative value for the radius and store it. If the radius entered is negative or is not a number, keep on prompting the user and accept values until a suitable value is entered.  Use the formula C=2*3.14* r to calculate and store the circumference. Output the circumference to the user and stop processing.

In class exercise

Write an algorithm in narrative form which gives instructions/directions on how to follow the rules in order to play “Snakes and ladders”.

© 2020  Vedesh Kungebeharry. All rights reserved.