Algorithm
Nihal and Harvir
Cement Pouring Company
1. Welcome user to our cement company. Basic levelled cement slabs start at $10 per cubic foot. Enter in measurements below to get a quote from us.
2. Ask user for width between 5 and 25 feet
3. Get the width
4. If (width < 5) or (width > 25)
5. Error message
6. Go to L2
7. Repeat until (width >= 5) and (width <= 25)
8. Ask user for length between width and 35 feet
9. Get the length
10. If (length <width) or (length >35) metres
11. Error message
12. Go to L8
13. Repeat until (length >=width) and (length <=35)
14. Ask user for depth between 2 and 6 inches
15. Get the depth
16. If depth is (<2) or (>6)
17. Error message
18. Go to L14
19. Repeat until depth (>=2) and (<=6) inches
20.calculate volume =(width) x (length) x (depth)
21. Product= volume x 10
22. Calculate taxes
23. GST = Product x 0.05
24. PST = Product x 0.07
25. TotalPrice = product + GST + PST
26. Display results (total price including taxes)
27. Ask user if they need to calculate another price
28. display option "yes" or "no"
29. If user answers neither "yes" or "no"
Display error message
Go back to L28
30: If user answers "yes"
Go to L1
31: If user answers "no"
End program
2. Ask user for width between 5 and 25 feet
3. Get the width
4. If (width < 5) or (width > 25)
5. Error message
6. Go to L2
7. Repeat until (width >= 5) and (width <= 25)
8. Ask user for length between width and 35 feet
9. Get the length
10. If (length <width) or (length >35) metres
11. Error message
12. Go to L8
13. Repeat until (length >=width) and (length <=35)
14. Ask user for depth between 2 and 6 inches
15. Get the depth
16. If depth is (<2) or (>6)
17. Error message
18. Go to L14
19. Repeat until depth (>=2) and (<=6) inches
20.calculate volume =(width) x (length) x (depth)
21. Product= volume x 10
22. Calculate taxes
23. GST = Product x 0.05
24. PST = Product x 0.07
25. TotalPrice = product + GST + PST
26. Display results (total price including taxes)
27. Ask user if they need to calculate another price
28. display option "yes" or "no"
29. If user answers neither "yes" or "no"
Display error message
Go back to L28
30: If user answers "yes"
Go to L1
31: If user answers "no"
End program