Question

Create a C# Console app Project in Visual Studios Menu: Room number Amenities Price 111 1...

Create a C# Console app Project in Visual Studios

Menu:
Room number Amenities Price
111 1 king size bed $130.00
112,113,114 2 double beds $145.00
211,212 1 queen size bed $125.00
213 1 double bed and 1 sofa bed $170.50

Write a program called HotelReservations that prompts a guest for a room number. Once the room selection is made, display the amenities and price for the room. Allow the guest to continue choosing multiple rooms if desired (displaying the amenities and price for each one selected). When the guest has no more rooms to select, they should type in -99 to stop selection. When the user enters -99, display the total cost of all rooms selected and end the program. If the user enters a room number that does not exist, the program should display “Input error – try again” and ask for another room selection. Use while loops and switch statements to solve this problem. Display all currency values with 2 decimal places.

Example output:

VolState Inn – Hotel Reservation System

Please enter a room number (or -99 to quit): 112 This is a room with 2 double beds priced at $145.00.

Please enter a room number (or -99 to quit): 110 Input error – try again

Please enter a room number (or -99 to quit): 212 This is a room with 1 queen size bed priced at $125.00.

Please enter a room number (or -99 to quit): -99 Total cost of rooms selected is $270.00.

*Please enter comments so I can better understand.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System;

public class HotelReservations
{
   public static void Main()
   {
       Console.WriteLine("VolState Inn – Hotel Reservation System");
      
       int total = 0;
       int roomNumber;
      
       do // loop while roomNumber != -99
       {
       Console.WriteLine("Please enter a room number (or -99 to quit): ");
       roomNumber = Convert.ToInt32(Console.ReadLine()); // input room Number
       if (roomNumber == -99) // exit condition
       break;
       // switch cases
       switch(roomNumber)
       {
           case 111:Console.WriteLine("This is a room with 1 King bed priced at $130.00.");
                   total = total + 130;
                       break;
          
           case 112:
           case 113:
           case 114:Console.WriteLine("This is a room with 2 double beds priced at $145.00.");
                       total = total + 145;
                       break;
          
          
           case 211:
           case 212:Console.WriteLine("This is a room with 1 queen size bed priced at $125.00.");
                       total = total + 125;
                       break;
          
           case 213: Console.WriteLine("This is a room with 1 double bed and 1 sofa bed priced at $170.00.");
                       total = total + 170;
                       break;
                      
           default: Console.WriteLine("Input error – try again");
                       break;
          
       }
       }while(roomNumber != -99);
      
Console.WriteLine("Total cost of rooms selected is ${0:0.00}",total);// display total cost
   }
}

Output:

VolState Inn – Hotel Reservation System

Please enter a room number (or -99 to quit): 112

This is a room with 2 double beds priced at $145.00.

Please enter a room number (or -99 to quit): 110

Input error – try again

Please enter a room number (or -99 to quit): 212

This is a room with 1 queen size bed priced at $125.00.

Please enter a room number (or -99 to quit): -99

Total cost of rooms selected is $270.00

Do ask if any doubt. Please upvote.

Add a comment
Know the answer?
Add Answer to:
Create a C# Console app Project in Visual Studios Menu: Room number Amenities Price 111 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write an application for the Shady Rest Hotel; the program determines the price of a room....

    Write an application 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 suite with king bed and a pullout couch. If the user enters an invalid code, display You selected an invalid...

  • C ++ Project Description The BlueMont chain hotels have 4 different types of room: Single room:...

    C ++ Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room:   $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this information as...

  • C++ Visual Studios Your program will attempt to guess a number that the user is thinking...

    C++ Visual Studios Your program will attempt to guess a number that the user is thinking of within the range [1, 20) (1 inclusive 20 exclusive). Your program will have 5 tries and each time the user should be able to tell your program if it is either correct, high, or low. If your program attempts 5 times but is not told that it is correct on the 5th try you should output "You cheated...". Otherwise your program should always...

  • 1. Create a C# app for the Hollywood Movie Rating Guide, which can be installed in...

    1. Create a C# app for the Hollywood Movie Rating Guide, which can be installed in a kiosk in theaters. Each theater patron enters a value from zero to for indicating the number of stars that the patron awards to the guide’s featured movie of the week. If a user enters a star value that does not fall in the correct range, prompt the user continuously until a correct value is entered. The program executes continuously until the theater manager...

  • **Use C++ ** Project Description The BlueMont chain hotels have 4 different types of room: Single...

    **Use C++ ** Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room:   $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this...

  • This is in c programming using functions in visual studios Carpet Jolb A carpeting company wants...

    This is in c programming using functions in visual studios Carpet Jolb A carpeting company wants to estimate what it will cost a customer to have a room carpeted. They can carpet 65 sq. ft. of room space in 4 hours, and they charge $25.00 per hour as their labor rate Write a program to ask the user for the length of the room (in inches) to be carpeted, the width of the room (in inches) to be carpeted, and...

  • Please use C++ and output have to look like that Create a menu driven C++ program...

    Please use C++ and output have to look like that Create a menu driven C++ program with functions. There must be four functions, calculating the size of area of circle, rectangle, triangle, and parallelogram. You are required to create those four functions and invoke them from the main program in order to reccive any credit. Please Submit: . A flowchart of your program with equations and expected results. 4 points) 2. Printout of your C++program with a heading comment, also...

  • Fix program errors and improve code Visual Studio C# Console App (.NET Framework) Task The program...

    Fix program errors and improve code Visual Studio C# Console App (.NET Framework) Task The program must allow for the teacher to either enter a predetermined number of scores (e.g. 10 exam scores), to keep allowing them to enter in scores until they are finished. You will need to convert these scores to a percentage then store these in a list. You will perform some calculations on these results and also display the contents of the list (percentage values) back...

  • In this project you will create a console C++ program that will have the user to...

    In this project you will create a console C++ program that will have the user to enter Celsius temperature readings for anywhere between 1 and 365 days and store them in a dynamically allocated array, then display a report showing both the Celsius and Fahrenheit temperatures for each day entered. This program will require the use of pointers and dynamic memory allocation. Getting and Storing User Input: For this you will ask the user how many days’ worth of temperature...

  • There are a sotall of five classes and one enum required for this project. Over the...

    There are a sotall of five classes and one enum required for this project. Over the course of the projeet, it is important that you pay attention to how different responsibilities are separaled between the classes and how they work in coejuncticn to handle a probiem A quick list of the necessary items for this peogram are HotelManagement Class This is the driver class foe your peogram It will cntain a methed for setting up an initial hotel and the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT