Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int days = int.Parse(Console.ReadLine()) - 1;
- string type = Console.ReadLine();
- string opinion = Console.ReadLine();
- double price = 0;
- if (type == "room for one person")
- {
- price = days * 18;
- if (opinion == "positive")
- {
- price += price * 0.25;
- }
- else if (opinion == "negative")
- {
- price -= price * 0.1;
- }
- }
- else if (type == "apartment")
- {
- if (days < 10)
- {
- price = days * 25;
- price -= price * 0.3;
- }
- else if (days >= 10 && days <= 15)
- {
- price = days * 25;
- price -= price * 0.35;
- }
- else if (days > 15)
- {
- price = days * 25;
- price -= price / 2;
- }
- if (opinion == "positive")
- {
- price += price * 0.25;
- }
- else if (opinion == "negative")
- {
- price -= price * 0.1;
- }
- }
- else if (type == "president apartment")
- {
- if (days < 10)
- {
- price = days * 35;
- price -= price * 0.1;
- }
- else if (days >= 10 && days <= 15)
- {
- price = days * 35;
- price -= price * 0.15;
- }
- else if (days > 15)
- {
- price = days * 35;
- price -= price * 0.2;
- }
- if (opinion == "positive")
- {
- price += price * 0.25;
- }
- else if (opinion == "negative")
- {
- price -= price * 0.1;
- }
- }
- Console.WriteLine($"{price:F2}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement