Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _07.HotelRoom
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights= int.Parse(Console.ReadLine());
- double suitePrice = 0;
- double flatPrice = 0;
- double totalSuitePrice = 0;
- double totalFlatPrice = 0;
- if (month == "May" || month == "October")
- {
- suitePrice = nights * 50;
- flatPrice = nights * 65;
- if (nights<=7)
- { totalSuitePrice = suitePrice;
- totalFlatPrice = flatPrice;
- }
- else if ( nights > 7 && nights<=14)
- { totalSuitePrice = suitePrice - (suitePrice * 0.05);
- totalFlatPrice = flatPrice;
- }
- else if ( nights > 14)
- { totalSuitePrice = suitePrice - (suitePrice * 0.3);
- totalFlatPrice = flatPrice - (flatPrice * 0.1);
- }
- }
- else if (month == "June" || month == "September")
- {
- suitePrice = nights * 75.20;
- flatPrice = nights * 68.70;
- if (nights<=14)
- { totalSuitePrice = suitePrice;
- totalFlatPrice = flatPrice;
- }
- else if ( nights > 14)
- { totalSuitePrice = suitePrice - (suitePrice * 0.2);
- totalFlatPrice = flatPrice - (flatPrice * 0.1);
- }
- }
- else if (month == "July"|| month== "August")
- { suitePrice = nights * 76;
- flatPrice = nights * 77;
- if (nights > 14)
- {
- totalFlatPrice = flatPrice - (flatPrice * 0.1);
- totalSuitePrice = suitePrice;
- }
- else{
- totalSuitePrice = suitePrice;
- totalFlatPrice = flatPrice;
- }
- }
- Console.WriteLine($"Apartment: {totalFlatPrice:F2} lv.");
- Console.WriteLine($"Studio: {totalSuitePrice:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment