Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ski_pochivka
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- string typeOfRoom = Console.ReadLine();
- string feedback = Console.ReadLine();
- double pricepernight = 0.0;
- double discount = 0.0;
- if (typeOfRoom == "roomPerOnePerson")
- {
- pricepernight = 18.00;
- }
- else if (typeOfRoom == "apartment")
- {
- pricepernight = 25.00;
- if (days > 10)
- {
- discount = 0.30;
- }
- else if (days >= 10 && days <= 15)
- {
- discount = 0.35;
- }
- else if (days > 15)
- {
- discount = 0.50;
- }
- }
- else if (typeOfRoom == "president apartment")
- {
- pricepernight = 35.00;
- if (days > 10)
- {
- discount = 0.10;
- }
- else if (days >= 10 && days <= 15)
- {
- discount = 0.15;
- }
- else if (days > 15)
- {
- discount = 0.20;
- }
- }
- int nights = days - 1;
- double totalExpenses = nights * pricepernight;
- totalExpenses = totalExpenses - totalExpenses * discount;
- Console.WriteLine(totalExpenses);
- if (feedback == "positive")
- {
- totalExpenses = totalExpenses + (totalExpenses * 0.25);
- }
- else if (feedback == "negative")
- {
- totalExpenses = totalExpenses - (totalExpenses * 0.1);
- }
- Console.WriteLine (($"{totalExpenses:F2}"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement