Write the selection statement within the pseudo code below in order to complete
ID: 3852210 • Letter: W
Question
Explanation / Answer
Pseudo code:
1. Start
2.
2.1 Read type of the car and store in carType variable.
2.2 Read rent code and store in rentCode variable.
2.3 Initialize numberOfDays to 0.
2.4 Initialize totalCharges to 0.
3. if carType is equal to 1 then
if rentCode is equal to 1 then
Read number of days and store in numberOfDays.
Calculate totalCharges as totalCharges = numberOfDays * 30;
else
Calculate totalCharges as totalCharges = 195;
else if carType is equal to 2 then
if rentCode is equal to 1 then
Read number of days and store in numberOfDays.
Calculate totalCharges as totalCharges = numberOfDays * 45;
else
Calculate totalCharges as totalCharges = 285;
else
if rentCode is equal to 1 then
Read number of days and store in numberOfDays.
Calculate totalCharges as totalCharges = numberOfDays * 55;
else
Calculate totalCharges as totalCharges = 350;
4. Display totalCharges
5. Stop
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.