In: Computer Science
(I AM IN A INTRO TO PROGRAMMING, PLEASE USE SIMPLE PSEUDOCODE IF POSSIBLE)
Create pseudocode for a program for Hansel's Housecleaning Service.
The program prompts the user for a customer's last name only. While the last name is not “zzz” your program will ask for the number of bathrooms and the number of other rooms to be cleaned and display the cleaning charge. You should use a sentinel-controlled while loop in your main loop logic. A customer name of “zzz” signals the end of the data.
The cleaning charge is $40 plus $15 for each bathroom and $10 for each of the other rooms. Use data validation loop to make sure the number of bathrooms is >= 0, and the number of other rooms is also >= 0. The program will display the total cleaning charge and then prompt for the next customer's name.
When the loop is exited (user enters “zzz” for the last name), display a message indicating that the program is complete.
Your program will have the main module and a function that, given the number of bathrooms and the number of other rooms, will return that total cleaning charge for the customer.
Here is your program pseudo code. Feel free to ask any doubt.
START
FUNCTION cleaning(bath,room)
   declare charge
   charge=40+bath*15+room*10
   RETURN charge
END FUNCTION
Declare bath, room, charge
Display "Welcome to the Hansel's Housecleaning
Service"
Display "Enter customer's last name"
Read name
WHILE( name!='zzz')
   WHILE(TRUE)
       Display " Enter the number of
bathrooms"
       Read bath
       Display " Enter the number of
rooms"
       Read room
       IF bath>=0 and room>=0
           break
       END IF
   END WHILE
   charge=cleaning(bath,room)
   Display "total cleaning charge for the customer"
charge
   Display ""Enter customer's last name"
   Read name
END WHILE
Display "Thanks for using Hansel's Housecleaning
Service"
STOP