Part A Write an application called ShadyRestRoom for the Shady Rest Hotel; the program determines the price of a room. Ask the user to choose 1 for a queen bed, 2 for a king, or 3 for a king and a pullout couch. The output echoes the input and displays the price of the room: $125 for queen, $139 for king, and $165 for a suite with a king bed and a pullout couch. If the user enters an invalid code, display an appropriate message and set the price to 0. An example of the program is shown below: Menu (1) Queen bed (2) King bed (3) Suite with a king bed and pull-out couch Enter Selection (1, 2, or 3) >> 2 You selected King bed $139 Part B Copy the contents of the ShadyRestRoom application into ShadyRestRoom2.java file and rename the class ShadyRestRoom2. Add a prompt to the ShadyRestRoom application to ask the user to specify a (1) lake view or a (2) park view, but ask that question only if the bed size entry is valid. Add $15 to the price of any room with a lake view. If the view value is invalid, display an appropriate message and assume that the price is for a room with a lake view. An example of the program is shown below: Menu (1) Queen bed (2) King bed (3) Suite with a king bed and pull-out couch Enter Selection (1, 2, or 3) >> 2 Please choose a view: (1) a lake (2) a park Enter Selection (1 or 2) >> 1 You selected King bed with a lake view for $154 Task 01: Create the ShadyRestRoom class. Task 02: The program ShadyRestRoom accepts the user selection for a room and displays the price of the room. Task 03: The ShadyRestRoom program handles an invalid room selection. Task 04: Create the ShadyRestRoom2 class. Task 05: The program ShadyRestRoom2 accepts the user selection for a room and displays the price of the room. Task 06: The ShadyRestRoom2 program handles an invalid room selection.
Part A
Write an application called ShadyRestRoom for the Shady Rest Hotel; the program determines the price of a room. Ask the user to choose 1 for a queen bed, 2 for a king, or 3 for a king and a pullout couch. The output echoes the input and displays the price of the room: $125 for queen, $139 for king, and $165 for a suite with a king bed and a pullout couch. If the user enters an invalid code, display an appropriate message and set the price to 0.
An example of the program is shown below:
Menu (1) Queen bed (2) King bed (3) Suite with a king bed and pull-out couch Enter Selection (1, 2, or 3) >> 2 You selected King bed $139
Part B
Copy the contents of the ShadyRestRoom application into ShadyRestRoom2.java file and rename the class ShadyRestRoom2. Add a prompt to the ShadyRestRoom application to ask the user to specify a (1) lake view or a (2) park view, but ask that question only if the bed size entry is valid. Add $15 to the price of any room with a lake view. If the view value is invalid, display an appropriate message and assume that the price is for a room with a lake view.
An example of the program is shown below:
Menu
(1) Queen bed
(2) King bed
(3) Suite with a king bed and pull-out couch
Enter Selection (1, 2, or 3) >> 2
Please choose a view:
(1) a lake
(2) a park
Enter Selection (1 or 2) >> 1
You selected King bed with a lake view for $154
Task 01: Create the ShadyRestRoom class.
Task 02: The program ShadyRestRoom accepts the user selection for a room and displays the price of the room.
Task 03: The ShadyRestRoom program handles an invalid room selection.
Task 04: Create the ShadyRestRoom2 class.
Task 05: The program ShadyRestRoom2 accepts the user selection for a room and displays the price of the room.
Task 06: The ShadyRestRoom2 program handles an invalid room selection.
![♡ Q 2 4 C
G
Unit 5: Making Decis X
CENGAGE COMPANION: COMMANDS
MindTap - Cengage X
Open Companion Tab
Refresh Companion Tab
Bundle Current Workspace
https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming-10e-5d83f9...
← →
Companion - studer X
J ShadyRestRoom.java X J ShadyRestRoom2.java
J ShadyRestRoom.java > ShadyRestRoom
115
116
117
118
119
120
121 System.out.println("an invalid choice!");
122
123
124
125
126
}
//appropriate message.
room_price = 0;
//set the price of room to and display an
//Close the scanner object.
127 sc.close();
128
129 }
130
131 }
Home | bartleby
student [Codespaces: literate sniffle]
> Codespaces: literate sniffle Ⓒ0A01 Java: Lightweight Mode
Bill eliminating drop X
田
HOME
Welcome
All
Home | Academics X +
☆ {} ()
= Companion X
·1+
How to Use the Code Editor
1. Select the "Run Code" button to execute
program.
2. Select the "Calculate Grade" button to genera
score based on the completed tasks.
3. Continue to modify, run, and calculate your c
until you are happy with the grade.
4. Select the "Submit" button to turn in
assignment to your instructor.
Part A
Write an application called ShadyRestRoom for
bash + I
M
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS 1
o@jbowen3225 →.../9780357673423_java-programming-10e-5d83f9ac-c9c6-4288-9e22-37326c529145/chapter5/ex03/student (template) $
B
4
Layout: US
08
x
Q](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F6cfcbabe-0283-4f69-afa3-58c47651b2d0%2F97a18e00-83c5-4af8-8ef0-4071c78ff21b%2Fp50s7sr_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)