A Hotel Resérvation Program Write a program that allows the user to reserve a room in a hotel and display the price of this reservation. The program will ask the user to choose a type of room, either single or double (S,D). Then the user will enter the number of nights. The price of each night according to the type: Туре price 200 $ 300$ The reservation cost = number of nights * room price. If the user enters a letter different from (S or D) for the type, then the program must display "invalid room description". If the user entered number of nights that less than or equal to 0, then the program must display "invalid number". Below are some sample runs:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

write the program using java

A Hotel Reservation Program
Write a program that allows the user to reserve a room in a hotel and display the price of this reservation. The
program will ask the user to choose a type of room, either single or double (S,D). Then the user will enter the
number of nights. The price of each night according to the type:
price
| 200 $
300$
Туре
The reservation cost = number of nights * room price.
If the user enters a letter different from (S or D) for the type, then the program must display "invalid room
description". If the user entered number of nights that less than or equal to 0, then the program must display
"invalid number". Below are some sample runs:
Sample Run 1:
run:
Enter Room type:
D
Enter view:
Enter number of nights
2
the reservation cost is 900
Sample Run 2:
run:
Enter Room type:
a
Enter view:
Enter number of nights
3
Invalid room description
Transcribed Image Text:A Hotel Reservation Program Write a program that allows the user to reserve a room in a hotel and display the price of this reservation. The program will ask the user to choose a type of room, either single or double (S,D). Then the user will enter the number of nights. The price of each night according to the type: price | 200 $ 300$ Туре The reservation cost = number of nights * room price. If the user enters a letter different from (S or D) for the type, then the program must display "invalid room description". If the user entered number of nights that less than or equal to 0, then the program must display "invalid number". Below are some sample runs: Sample Run 1: run: Enter Room type: D Enter view: Enter number of nights 2 the reservation cost is 900 Sample Run 2: run: Enter Room type: a Enter view: Enter number of nights 3 Invalid room description
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning