Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Hotel
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double studioPrice = 0;
- double doublePrice = 0;
- double suitePrice = 0;
- switch (month)
- {
- case "May":
- studioPrice = 50 * nights;
- doublePrice = 65 * nights;
- suitePrice = 75 * nights;
- if (nights > 7)
- {
- studioPrice = studioPrice * 0.95;
- }
- break;
- case "June":
- studioPrice = 60 * nights;
- doublePrice = 72 * nights;
- suitePrice = 82 * nights;
- if (nights > 14)
- {
- doublePrice = doublePrice * 0.90;
- }
- break;
- case "July":
- studioPrice = 68 * nights;
- doublePrice = 77 * nights;
- suitePrice = 89 * nights;
- if (nights > 14)
- {
- suitePrice = suitePrice * 0.85;
- }
- break;
- case "August":
- studioPrice = 68 * nights;
- doublePrice = 77 * nights;
- suitePrice = 89 * nights;
- if (nights > 14)
- {
- suitePrice = suitePrice * 0.85;
- }
- break;
- case "September":
- studioPrice = 60 * nights;
- doublePrice = 72 * nights;
- suitePrice = 82 * nights;
- if (nights > 14)
- {
- doublePrice = doublePrice * 0.90;
- }
- if (nights > 7)
- {
- studioPrice = studioPrice - 60;
- }
- break;
- case "October ":
- studioPrice = 50 * nights;
- doublePrice = 65 * nights;
- suitePrice = 75 * nights;
- if (nights > 7)
- {
- studioPrice = studioPrice * 0.95 - 50*0.95;
- }
- break;
- case "December":
- studioPrice = 68 * nights;
- doublePrice = 77 * nights;
- suitePrice = 89 * nights;
- if (nights > 14)
- {
- suitePrice = suitePrice * 0.85;
- }
- break;
- }
- Console.WriteLine("Studio: {0:f2} lv.", studioPrice);
- Console.WriteLine("Double: {0:f2} lv.", doublePrice);
- Console.WriteLine("Suite: {0:f2} lv.", suitePrice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement