subject

DEBUG // 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.

start
Declarations
string carType
num days
num STD_RATE = 65
num COM_RATE = 40
num SUB_RATE = 30
num DAYS_FOR_DISCOUNT = 10
num DISCOUNT_RATE = 0.20
string QUIT = ""
getReady()
while carType <> QUIT
detailLoop()
endwhile
finish()
stop

getReady()
output Enter car type or , QUIT, to quit
input carType
return

detailLoop()
output "Enter days rented "
input days
if carType = "Standard" then
rate = STD_RATE
else
if car_Type = "Compact" then
rate = COMPACT_RATE
else
if carType = "Subcompact" then
rate = SUB_RATE
else
rate = 0
output "Invalid car type"
endif
endif
endif
if rate <> 0
if days >= DAYS_FOR_DISCOUNT then
rate = rate * DISCOUNT_RATE
endif
output carType, days
output "Enter car type or ", QUIT, " to quit "
input carType
return

finish()
output "End of program"
return

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 24.06.2019 22:30
Distinguish between a skill resume and a chronological resume and explain when it is best to use each format
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Website hosting servers have their own unique ip address, what does this address consist of? a. numbers and letters b. numbers c. letters d. letters and symbols
Answers: 2
question
Computers and Technology, 25.06.2019 10:10
Suppose you and your friend live on the same street d miles away from each other. between your house and your friend’s house there are n motorized scooters positioned at distances x1, x2, . . , xn miles from your house towards your friend’s house. each scooter has a battery that may or may not be fully charged. let’s say that the scooters can take you distances d1, d2, . . , dn miles down the road. each scooter also has a price p1, p2, . . , pn that it takes to activate. any time you encounter another scooter, you may take the new scooter and leave your old scooter behind. there is an additional scooter at your house that you start with and it can go distance d0 miles and it is free to activate: p0 = 0. you wish to go to your friend’s house minimizing the total amount of money spent activating the scooters. design a dynamic programming algorithm that returns the minimum cost to get to your friend’s house using scooters x0, . . , xn.
Answers: 1
You know the right answer?
DEBUG // This pseudocode should determine and output the rental fees for cars.
// Standard c...
Questions
question
Mathematics, 03.02.2021 03:30
question
Chemistry, 03.02.2021 03:30
question
Mathematics, 03.02.2021 03:30
question
Mathematics, 03.02.2021 03:30
question
Mathematics, 03.02.2021 03:30
question
Mathematics, 03.02.2021 03:30
question
Mathematics, 03.02.2021 03:30
Questions on the website: 13722363