Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Room_in_Hotel_19
- {
- class Program
- {
- static void Main(string[] args)
- {
- var month = Console.ReadLine(); // месец
- var overnights = int.Parse(Console.ReadLine()); // # нощувки
- double priceApp = 0;
- double priceStudio = 0;
- switch (month)
- {
- case "May": priceStudio = 50; break;
- case "June": priceStudio = 75.20; break;
- case "July": priceStudio = 76; break;
- case "August": priceStudio = 76; break;
- case "September": priceStudio = 75.20; break;
- case "October": priceStudio = 50; break;
- default: break;
- }
- switch (month)
- {
- case "May": priceApp = 65; break;
- case "June": priceApp = 68.70; break;
- case "July": priceApp = 77; break;
- case "August": priceApp = 77; break;
- case "September": priceApp = 68.70; break;
- case "October": priceApp = 65; break;
- }
- if (((overnights > 7) && (overnights <= 14))
- && ((month == "May") || (month == "October")))
- {
- priceStudio = priceStudio * (1 - 0.05);
- }
- if ((overnights > 14) && ((month == "May") || (month == "October")))
- {
- priceStudio = priceStudio * (1 - 0.30);
- }
- if ((overnights > 14) && ((month == "June") || (month == "September")))
- {
- priceStudio = priceStudio * (1 - 0.20);
- }
- if (overnights > 14)
- {
- priceApp = priceApp * (1 - 0.10);
- }
- double sumApp = priceApp * overnights;
- double sumStudio = priceStudio * overnights;
- Console.WriteLine($"Apartment: {sumApp:f2} lv.");
- Console.WriteLine($"Studio: {sumStudio:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement