(I AM IN A INTRO TO PROGRAMMING, PLEASE USE SIMPLE PSEUDOCODE IF POSSIBLE) Create pseudocode for a...

Free

90.2K

Verified Solution

Question

Programming

(I AM IN A INTRO TO PROGRAMMING, PLEASE USE SIMPLE PSEUDOCODE IFPOSSIBLE)

Create pseudocode for a program for Hansel's HousecleaningService.

The program prompts the user for a customer's last name only.While the last name is not “zzz” your program will ask for thenumber of bathrooms and the number of other rooms to be cleaned anddisplay the cleaning charge. You should use a sentinel-controlledwhile 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 $10for each of the other rooms. Use data validation loop to make surethe number of bathrooms is >= 0, and the number of other roomsis also >= 0. The program will display the total cleaning chargeand 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, willreturn that total cleaning charge for the customer.

Answer & Explanation Solved by verified expert
3.8 Ratings (455 Votes)

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


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students