Draw the hierarchy chart and design the logic for a program that calculates service charges for Hazel’s Housecleaning service. The program contains housekeeping, detail loop, and end-of-job modules. The main program declares any needed global variables and constants and calls the other modules. The housekeeping module displays a prompt for and accepts a customer’s last name. While the user does not enter ZZZZ for the name, the detailed loop accepts the number of bathrooms and the number of other rooms to be cleaned. The service 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.

Ion know

To design the logic for the program that calculates service charges for Hazel's Housecleaning service, you can follow these steps:

1. Start by drawing a hierarchy chart to visualize the program structure. The hierarchy chart will show the main program, housekeeping module, detail loop module, and end-of-job module.

Hierarchy Chart:

```
Main Program
|
+--------+---------+
| | |
Housekeeping | End-of-Job
|
Detail Loop
```

2. Declare any needed global variables and constants. In this case, you'll need variables for the customer's last name, number of bathrooms, number of other rooms, and the service charge.

Global Variables:
- lastName (string)
- numBathrooms (integer)
- numOtherRooms (integer)
- serviceCharge (float)

Constants:
- BATHROOM_CHARGE ($15)
- OTHER_ROOM_CHARGE ($10)

3. Define the housekeeping module. This module will display a prompt for and accept the customer's last name as input. This module will then call the detail loop module.

Housekeeping Module:
- Display prompt for the customer's last name.
- Accept the customer's last name as input.
- Call the detail loop module.

4. Define the detail loop module. This module will run a loop until the user enters "ZZZZ" for the name. Within the loop, it will accept the number of bathrooms and other rooms to be cleaned from the user. It will then calculate and display the service charge. After each iteration, it will prompt the user for the next customer's name. If the name entered is "ZZZZ", it will return to the housekeeping module.

Detail Loop Module:
- Start a loop:
- Display prompt for the number of bathrooms.
- Accept the number of bathrooms as input.
- Display prompt for the number of other rooms.
- Accept the number of other rooms as input.
- Calculate the service charge using the formula: serviceCharge = $40 + (numBathrooms * BATHROOM_CHARGE) + (numOtherRooms * OTHER_ROOM_CHARGE).
- Display the service charge.
- Prompt for the next customer's name.
- If the name is "ZZZZ", exit the loop and return to the housekeeping module.

5. Define the end-of-job module. This module executes after the user enters the sentinel value "ZZZZ" for the name. It displays a message indicating that the program is complete.

End-of-Job Module:
- Display a message indicating that the program is complete.

6. Finally, implement the main program. The main program should call the housekeeping module to start the process.

Main Program:
- Call the housekeeping module.

You have now designed the logic for the program that calculates service charges for Hazel's Housecleaning service. You can proceed with implementing this logic in the programming language of your choice.