This pseudocode should determine and output the

This preview shows page 3 - 4 out of 4 pages.

// This pseudocode should determine and output// the rental fees for cars.// Standard cars rent for $65 per day,// compacts rent for $40 per day,// and subcompacts rent for $30 per day.// Rentals for at least 7 days receive a 20% discount.// An error message is displayed if the car type// is not valid.startDeclarationsstring carTypenum daysnum STD_RATE = 65num COM_RATE = 40num SUB_RATE = 30num DAYS_FOR_DISCOUNT = 7num DISCOUNT_RATE = 0.20string QUIT = "ZZZ"getReady()while carType = QUIT detailLoop()endwhilefinishUp()stopdetailLoop()output "Enter days rented "input daysif carType = "Standard" thenrate = STD_RATE
elseif carType = "Compact" thenrate = COMPACT_RATEelseif carType = "Subcompact" thenrate = SUB_RATEelseoutput "Invalid car type"endifendifendifif days >= DAYS_FOR_DISCOUNT thenrate = rate * DISCOUNT_RATEendifoutput carType, daysoutput "Enter car type or ", QUIT, " to quit "input carTypereturngetReady()output Enter car type orQUIT to quitinput carTypereturnfinishUp()output "End of program"return

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture