In: Computer Science
The SuperFast Car Rental company wishes to rewrite their order processing program and needs a flowchart and pseudocode for their new algorithm. The rules used to process the orders are listed below:
Three car types are available for rent: Compact, Economy and Intermediate. Their prices per day are as follows:
o Compact: $50 per day
o Economy: $60 per day
o Intermediate: $70 per day
Loss Damage Waiver is also offered at $25 per day. This is optional.
Roadside Issues Coverage is also provided at $9 per day. This is also optional.
The Sales Tax to be added is 7% of the total rental price including the optional items, if any.
Inputs:
*Number of rental days
*Type of Car: Compact, Economy or Intermediate.
*Loss Damage Waiver: Yes or No.
*Roadside Issues Coverage: Yes or No.
Outputs:
*Total rental price (excluding optional items).
*Total for the optional items
*Sales Tax amount to be added to the bill
*Total amount of the bill (including the tax)
SAMPLE TRACES THROUGH THE CORRECT ALGORITHM
Sample 1:
INPUT:
Days: 2
Car type = Compact
Loss Damage Waiver = Yes
Roadside Issues Coverage = No
OUTPUT:
Total Rental Price = $100.00
Total Optional Items = $50.00
Tax Amount = $10.50
Total Amount = $160.50
Sample 2:
INPUT:
Days: 3
Car type = Economy
Loss Damage Waiver = No
Roadside Issues Coverage = Yes
OUTPUT:
Total Rental Price = $180.00
Total Optional Items = $27.00
Tax Amount = $14.49
Total Amount = $221.49
Sample 3
INPUT:
Days:3
Car type = Intermediate
Loss Damage Waiver = Yes
Roadside Issues Coverage: Yes
OUTPUT:
Total Rental Price = $210.00
Total Optional Items = $102.00
Tax Amount = $21.84
Total Amount = $333.84