Course Hero Logo

Fix#1-4_M04.docx - M04 Debugging Exercises Exercise #1 /...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 3 out of 7 pages.

M04 Debugging ExercisesExercise #1// This pseudocode should create a report that contains an// apartment complex rental agent's commission. The// program accepts the ID number and name of the agent who// rented the apartment, and the number of bedrooms in the// apartment. The commission is $100 for renting a three-bedroom// apartment, $75 for renting a two-bedroom apartment, $55 for// renting a one-bedroom apartment, and $30 for renting a studio// (zero-bedroom) apartment. Output is the salesperson’s// name and ID number and the commission earned on the rental.startDeclarationsnum salesPersonIDstringsalesPersonName(I think it should say num instead of string since all the variables are num)num numBedroomsnum COMM_3 = $100.00num COMM_2 = $75.00num COMM_1 = $55.00num COMM_STUDIO = $30.00num QUIT = 9999getReady()while salesPersonID <> QUITdetailLoop()endwhilefinish()stop
getReady()output "Enter salesperson ID or ", QUIT, " to quit "output salesperson_IDreturndetailLoop()output "Enter name "input salesPersonNameoutput "Enter number of bedrooms rented "input numBedroomsif numBedrooms > 3 thencommissionEarned = COMM_3elseif numBedrooms <2 then(I think it should be >)commissionEarned = COMM_2elseif numBedrooms > 1 thencommission = COMM_1elsecommission = COMM_4endifendifendifoutput salesPersonID, salesPersName, commissionEarnedoutput "Enter salesperson ID or ", QUIT, " to quit "

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture