For the name the detail loop accepts the number of

This preview shows page 8 - 11 out of 11 pages.

for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned. The service
main program housekeeping() detailLoop() endOfJob() charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. The detail loop also displays the service charge and then prompts the user for the next customer's name. The end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete. Hierarchy chart :
Flowchart: Pseudocode: start Declarations string customerLastName num numOfBaths num numOfOtherRooms num serviceCharge num CHARGE_BASE = 40 num CHARGE_BATH = 15 num CHARGE_OTHER_ROOM = 10 string QUIT = “ZZZZ” string NAME_PROMPT = “Enter the customer’s last name: ” string BATH_PROMPT = “Enter the number of bathrooms to be cleaned: ” string ROOMS_PROMPT = “Enter the number of other rooms to
be cleaned: ” string END_LINE = “Thank you for using the program” housekeeping() while customerLastName <> QUIT detailLoop() endwhile endOfJob() stop housekeeping() output NAME_PROMPT input customerLastName return detailLoop() output BATH_PROMPT input numOfBaths output ROOM_PROMPT input numOfOtherRooms serviceCharge = CHARGE_BASE + (CHARGE_BATH * numOfBaths) + (CHARGE_ROOM * numOfOtherRooms) output serviceCharge output NAME_PROMPT input customerLastName return endOfJob() output END_LINE return

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture