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

Draw the hierarchy chart and design the logic that calculates service charges fo

ID: 3679513 • Letter: D

Question

Draw the hierarchy chart and design the logic that calculates service charges for hazel's Housecleaning service. the program contains housekeeping,detail loop, and end-job modules. the main program declares any needed global variables and constants and calls the other modules. The housecleaning module displays a prompt for and accepts a customers last name. While the user does not enter ZZZZ for the name, the detail, the detail 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.

Explanation / Answer

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

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