Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp17
- {
- class Program
- {
- static void Main(string[] args)
- {
- int day = int.Parse(Console.ReadLine());
- string room = Console.ReadLine();
- string grade = Console.ReadLine();
- double price = 0;
- double finalprice = 0;
- double discount = 0;
- double overnight = day - 1;
- double roomForOnePerson = 18;
- double apartment = 25;
- double presidentApartment = 35;
- if (room == "room for one person")
- {
- price = overnight * roomForOnePerson;
- }
- if (room == "apartment")
- {
- if (day < 10)
- {
- price = overnight * apartment;
- discount = price * 0.30;
- finalprice = price - discount;
- }
- else if (day > 10 && day < 15)
- {
- price = overnight * apartment;
- discount = price * 0.35;
- finalprice = price - discount;
- }
- else if (day > 15)
- {
- price = overnight * apartment;
- discount = price * 0.50;
- finalprice = price - discount;
- }
- }
- if (room == "president apartment")
- {
- if (day < 10)
- {
- price = overnight * presidentApartment;
- discount = price * 0.10;
- finalprice = price - discount;
- }
- else if (day > 10 && day < 15)
- {
- price = overnight * presidentApartment;
- discount = price * 0.15;
- finalprice = price - discount;
- }
- else if (day > 15)
- {
- price = overnight * presidentApartment;
- discount = price * 0.20;
- finalprice = price - discount;
- }
- }
- if (grade == "positive")
- {
- if (room == "room for one person")
- {
- price = price + (price * 0.25);
- Console.WriteLine($"{price:f2}");
- }
- else if (room == "apartment" || room == "president apartment")
- {
- finalprice = finalprice + (finalprice * 0.25);
- Console.WriteLine($"{finalprice:f2}");
- }
- }
- else if (grade == "negative")
- {
- if (room == "room for one person")
- {
- price = price - (price * 0.10);
- Console.WriteLine($"{price:f2}");
- }
- else if (room == "apartment" || room == "president apartment")
- {
- finalprice = finalprice - (finalprice * 0.10);
- Console.WriteLine($"{finalprice:f2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement