Flowchart exampleThis simple flowchart starts and ends with terminators as all algorithms do. It receives input from the user of the price of an item and stores it as price.
If the price is over £100 then the discount variable is assigned a value of 20% and we move on to the outut stage. If not we proceed on to check if the price is above £50. We already know it is less than
£100 so we are really checking if it is between 51 and 100. If the second check is made and it is true, discount will be assigned a value of 10% and if it is false then discount will be assigned a value of 5%.
Regardless of which path was taken from the selection structure the final step is to output the string "The discount is" followed by whatever is stored in the discount variable. Then the algorithm ends. |