Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Demo
- {
- class Program
- {
- static void Main(string[] args)
- {
- //A restaurant want to automate their reservation process. They need a program that reads the hall and the count of people
- //from the console and calculates how much the customer should pay to book the place.
- int groupSize = int.Parse(Console.ReadLine());
- string package = Console.ReadLine();
- string hall = "";
- double price = 0;
- if (groupSize > 120)
- {
- Console.WriteLine("We do not have an appropriate hall.");
- return;
- }
- if (groupSize <= 50)
- {
- price += 2500;
- hall = "Small Hall";
- }
- else if (groupSize <= 100)
- {
- price += 5000;
- hall = "Terrace";
- }
- else if (groupSize <= 120)
- {
- price += 7500;
- hall = "Great Hall";
- }
- switch (package)
- {
- case "Normal":
- price += 500;
- price *= 0.95;
- break;
- case "Gold":
- price += 750;
- price *= 0.90;
- break;
- case "Platinum":
- price += 1000;
- price *= 0.85;
- break;
- default:
- break;
- }
- Console.WriteLine($"We can offer you the {hall}");
- Console.WriteLine($"The price per person is {price/groupSize:f2}$");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment