Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Debugging Section Exercise #1 50 points Plus up to 10 points extra The following

ID: 3576515 • Letter: D

Question

Debugging Section Exercise #1 50 points Plus up to 10 points extra The following pseudocode contains errors. You must find 3 or more errors in each of the following programs. If you find more than 3 mistakes, you will earn extra credit points. This pseudocode should determine 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 The program exits when the user enters in Start Declarations string car Type num days num STD RATE 65 num COM RATE 40 num SUB RATE 30 num DAYS FOR DISCOUNT 7 num DISCOUNT RATE 0.20 string QUIT "zzzz" getReady while car Type QUIT detail Loop end while finish Stop getReady output Enter car type or QUIT to quit input carType return detail Loop output Enter days rented input days if car Type Standard then rate STD RATE else if car Type Compact then rate COM RATE else if car Type Subcompact then rate SUB RATE

Explanation / Answer

Errors:

1> finish() statement will come at the last.

2> There is no endif statements for the if statements in the detailLoop() function.

3> there is no need of return at the end of the program. We have already put in function.

4>there is no 'endif' for the 'if rate <> 0' statement.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote