ALGORITHM RECTANGLE
Partner project, Joel and Aman
Welcome to Joel and Aman's pool building company
- GST = 5%
- PST = 7%
- Part A
- Ask user for width of the pool in meters and save it as Width
- if (width < 10) or (width > 50) :
- Say “ invalid input ” width needs to be greater than 10 and less than 50
- until (width > 10) and (width < 50)
- Loop to Part A
- Part B
- Ask user for length and save it as Length
- if (length < width) or (length > 65) :
- Say “ invalid input” length has to be greater than width and less than 65
- until length < width
- loop to Part B
- Part C
- Ask for depth in feet and save it as Depth
- if (depth < 1) or (depth > 20)
- Say” invalid input” Depth has to be a greater than 0 and less than 25 feet
- until ( depth > 1) and (depth < 20)
- Loop to Part C
- Part D
- Calculate volume of the pool by doing length * width * depth and store it as volume
- if operation == price
- Ask for cost per cubic meter and save it as cost
- if ( cost < 1) or ( cost > 200)
- Say "invalid input” cost has to be a number greater than 1 and less than 55,000
- until (cost >1) and ( cost < 55,000)
- Loop to Part D
- Part E
- Ask for employment fee and save it as labour_fee
- if labour_fee is < 0
- Say “ invalid input ” labour_fee has to be > than 0
- Loop Part E
- price = volume * cost
- GST_price = price * GST
- PST_price = price * PST
- total_price = GST_price + PST_price + price + labour fee
- Part F
- display results for dimensions
- length is : ‘ length + meters ’
- width is: ‘ width + meters ’
- depth is: ‘ depth + feet ’
- volume is: ‘ length * width * depth ‘
- total dimensions are: volume + cubic meters ‘
- display result for price
- cost per cubic meter: ‘ $ + cost ‘
- labour fee: ' $ + labour fee ‘
- Total price: ‘ cubic meter + labour fee ‘
- Part G
- Ask user if they want to repeat the whole purpose and save it as choice
- if the choice == Yes
- then loop back to line 1
- if the choice == No
- then end the program
- if the choice neither yes and no
- loop back part G