Java Programming (MindTap Course List)
Java Programming (MindTap Course List)
9th Edition
ISBN: 9781337397070
Author: Joyce Farrell
Publisher: Cengage Learning
bartleby

Videos

Question
Book Icon
Chapter 5, Problem 3PE

a.

Program Plan Intro

Determine the price of a selected room

Program plan:

  • Import necessary package.
  • Create a class “ShadyRestRoom”,
    • Define the method “main ()”,
      • Declare the necessary variables.
      • Declare the necessary final variables.
      • Create “Scanner” object.
      • Print the menu.
      • Prompt the user to enter the choice.
      • Get the choice from the user using “nextInt()”.
      • Check whether the choice is queen,
        • Assign the corresponding text for a queen.
        • Assign the corresponding price for a room.
      • Otherwise, check whether the choice is a king,
        • Assign the corresponding text for a king.
        • Assign the corresponding price for a room.
      • Otherwise, check whether the choice is a suite,
        • Assign the corresponding text for a suite.
        • Assign the corresponding price for a suite.
      • Otherwise,
        • Assign the invalid text.
        • Set the price value to “0”.
      • Print the output.

b.

Program Plan Intro

Determine the price of a selected view

Program plan:

  • Import necessary package.
  • Create a class “ShadyRestRoom2”,
    • Define the method “main ()”,
      • Declare the necessary variables.
      • Declare the necessary final variables.
      • Create “Scanner” object.
      • Print the menu.
      • Prompt the user to enter the choice.
      • Get the choice from the user using “nextInt()”.
      • Check whether the choice is queen,
        • Assign the corresponding text for a queen.
        • Assign the corresponding price for a room.
      • Otherwise, check whether the choice is a king,
        • Assign the corresponding text for a king.
        • Assign the corresponding price for a room.
      • Otherwise, check whether the choice is a suite,
        • Assign the corresponding text for a suite.
        • Assign the corresponding price for a suite.
      • Otherwise,
        • Assign the invalid text.
        • Set the price value to “0”.
      • Check whether the price is not equal to “0”,
        • Prompt the user to enter the view.
        • Print the view and the corresponding text.
        • Prompt the user to enter the choice of view.
        • Get the view choice from the user.
        • Check whether the choice is lake,
          • If it is true, assign the corresponding text for a lake.
          • Update the price.
            • Otherwise, check whether the choice is a park,
              • If it is true, assign the corresponding text for a park.
            • Otherwise,
              • Update the price.
              • Assign the error text message.
      • Print the output.

Blurred answer
Students have asked these similar questions
Problem Statement You are working as a Devops Administrator. Y ou’ve been t asked to deploy a multi - tier application on Kubernetes Cluster. The application is a NodeJS application available on Docker Hub with the following name: d evopsedu/emp loyee This Node JS application works with a mongo database. MongoDB image is available on D ockerHub with the following name: m ongo You are required to deploy this application on Kubernetes: • NodeJS is available on port 8888 in the container and will be reaching out to por t 27017 for mongo database connection • MongoDB will be accepting connections on port 27017 You must deploy this application using the CL I . Once your application is up and running, ensure you can add an employee from the NodeJS application and verify by going to Get Employee page and retrieving your input. Hint: Name the Mongo DB Service and deployment, specifically as “mongo”.
I need help in server client project. It is around 1200 lines of code in both . I want to meet with the expert online because it is complicated. I want the server send a menu to the client and the client enters his choice and keep on this until the client chooses to exit . the problem is not in the connection itself as far as I know.I tried while loops but did not work. please help its emergent
I need help in my server client in C language
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License