Write the selection statement within the pseudo code below in order to complete
ID: 3829768 • Letter: W
Question
Write the selection statement within the pseudo code below in order to complete the pseudo code.. A rental car company used the following procedure to determine the total charge: car Type: 1 - Compact $30 per day/$195 per week 2 - Medium used $40 per day/$285 per week 3 - Luxury $55 per day/$350 per week Input (from user): Car type (1, 2, or 3) Rent code - (1 - daily or 2 - weakly) Number of day - (set to 0 if rented by the week. Customers cannot rent for more than 1 week) Output: Customer's total Bill Note that there is no need to validate the input. Complete the pseudo code here to include the proper selection statement: integer car Type = 0 integer real Code = 0 integer nine Days = 0 integer bill = 0 Output "Please enter the type of car (1 - Compact, 2 - Medium, 3 - luxury)" Input car Type Output "Please enter the rent code (1 - Daily, 2 - weekly)" Input rent Code Output "Please enter the number of days rented (0 if rented by the weekly)" Input DaysExplanation / Answer
Here is the completed pseudo Code,
Psuedo Code
Integer carType = 0
Integer rentCode = 0
Integer numDays = 0
Integer bill = 0
Output “Please enter the type of car (1- Compact, 2- Medium, 3- Luxury)”
Input carType
Output “Please enter the rent code (1-Daily, 2-Weekly)”
Input rentCode
Input “Please enter the number of days rented (0 if rented by the weekly)”
Input numDays
Case based on carType
Case 1
If rentCode = 0
bill = 195
Else
bill = rentCode * 30
Case 2
If rentCode = 0
bill = 285
Else
bill = rentCode * 45
Case 3
If rentCode = 0
bill = 350
Else
bill = rentCode * 55
Default
Output “Invalid car type”
End Case
Output “Customer’s Total Bill = “, bill
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.