Question: Examine the pseudocode below. Find all the syntax / or logical errors. Correct the errors. / / This pseudocode should determine and output / /
Examine the pseudocode below. Find all the syntax or logical errors. Correct the errors.
This pseudocode should determine and output
the rental fees for cars.
Standard cars rent for $ per day,
compacts rent for $ per day,
and subcompacts rent for $ per day.
Rentals for at least days receive a discount.
An error message is displayed if the car type
is not valid.
start
Declarations
string carType
num days
num STDRATE
num COMRATE
num SUBRATE
num DAYSFORDISCOUNT
num DISCOUNTRATE
string QUIT ZZZZ
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 STDRATE
else
if carType "Compact" then
rate COMPACTRATE
else
if carType "Subcompact" then
rate SUBRATE
else
rate
output "Invalid car type"
endif
endif
endif
if rate
if days DAYSFORDISCOUNT then
rate rate DISCOUNTRATE
endif
output carType, days
output "Enter car type or QUIT, to quit
input carType
return
finish
output "End of program"
return
WeekDebug.txtDownload WeekDebug.txt
Create a word document using the Course Template. Download the text file above and copy and paste it into the Course Template to make changes in Word that need to be made. Change the font color to bluefor the changes. When you are done, submit that word document to the dropbox.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
