Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace skivacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int stay = int.Parse(Console.ReadLine());
- string roomType = Console.ReadLine();
- string opinion = Console.ReadLine();
- double price = 0;
- int night = stay - 1;
- if (roomType == "singleRoom")
- {
- if (stay < 10)
- {
- price = night * 18;
- }
- else if (stay >= 10 && stay <= 15)
- {
- price = night * 18;
- }
- else if (stay > 15)
- {
- price = night * 18;
- }
- }
- else if (roomType == "apartment")
- {
- if (stay < 10)
- {
- price = night * 25;
- price = price - price * 0.30;
- }
- else if (stay >= 10 && stay <= 15)
- {
- price = night * 25;
- price = price - price * 0.35;
- }
- else if (stay > 15)
- {
- price = night * 25;
- price = price - price * 0.50;
- }
- }
- else if (roomType == "president apartment")
- {
- if (stay < 10)
- {
- price = night * 35;
- price = price - price * 0.10;
- }
- else if (stay >= 10 && stay <= 15)
- {
- price = night * 35;
- price = price - price * 0.15;
- }
- else if (stay > 15)
- {
- price = night * 35;
- price = price - price * 0.20;
- }
- }
- if (opinion=="positive")
- {
- price=price+price*0.25;
- Console.WriteLine($"{price:f2}");
- }
- else
- {
- Console.WriteLine($"{price - price * 0.10:F2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement