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 DomashnoSkiTrip
- {
- class Program
- {
- static void Main(string[] args)
- {
- int daysToStay = int.Parse(Console.ReadLine());
- string roomType = Console.ReadLine().ToLower();
- string feedBack = Console.ReadLine().ToLower();
- double positiveFeedBackPercentageToAdd = 25;
- double negativeFeedBackPercentageDiscount = 10;
- double nightsToPay = daysToStay - 1;
- double discountForNight = 0;
- double onePersonRoomPrice = 18;
- double apartmentPrice = 25.00;
- double presidentApartmentPrice = 35.00;
- double totalCost = 0;
- switch (roomType)
- {
- case "room for one person":
- {
- if (feedBack == "positive")
- {
- totalCost = nightsToPay * onePersonRoomPrice * (1 + (1.00*positiveFeedBackPercentageToAdd/100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else
- {
- totalCost = nightsToPay * onePersonRoomPrice * (1.00 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- }
- break;
- case "apartment":
- {
- switch (feedBack)
- {
- case "positive":
- if (daysToStay >= 0 && daysToStay < 10)
- {
- discountForNight = 30;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00*positiveFeedBackPercentageToAdd/100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay >= 10 && daysToStay <= 15)
- {
- discountForNight = 35;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00 * positiveFeedBackPercentageToAdd / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay > 15)
- {
- discountForNight = 50;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00 * positiveFeedBackPercentageToAdd / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- break;
- case "negative":
- if (daysToStay >= 0 && daysToStay < 10)
- {
- discountForNight = 30;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1-(1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay >= 10 && daysToStay <= 15)
- {
- discountForNight = 35;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay > 15)
- {
- discountForNight = 50;
- totalCost = (nightsToPay * apartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- break;
- }
- }
- break;
- case "president apartment":
- switch (feedBack)
- {
- case "positive":
- if (daysToStay >= 0 && daysToStay < 10)
- {
- discountForNight = 10;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00 * positiveFeedBackPercentageToAdd / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay >= 10 && daysToStay <= 15)
- {
- discountForNight = 15;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00 * positiveFeedBackPercentageToAdd / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay > 15)
- {
- discountForNight = 20;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 + (1.00 * positiveFeedBackPercentageToAdd / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- break;
- case "negative":
- if (daysToStay >= 0 && daysToStay < 10)
- {
- discountForNight = 10;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay >= 10 && daysToStay <= 15)
- {
- discountForNight = 15;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- else if (daysToStay > 15)
- {
- discountForNight = 20;
- totalCost = (nightsToPay * presidentApartmentPrice * (1.00 - (1.00 * discountForNight / 100))) * (1 - (1.00 * negativeFeedBackPercentageDiscount / 100));
- Console.WriteLine($"{totalCost:F2}");
- }
- break;
- }
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement