Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace IzpitnaZadacha8
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double priceStudio = 0;
- double priceApartment = 0;
- if (month == "May" || month == "October")
- {
- if (nights < 7)
- {
- priceStudio = (nights * 50);
- priceApartment = (nights * 65);
- }
- else if (7 <= nights && nights <= 14)
- {
- priceStudio = (nights * 50) * 0.95;
- priceApartment = (nights * 65);
- }
- else
- {
- priceStudio = (nights * 50) * 0.7;
- priceApartment = (nights * 65) * 0.9;
- }
- }
- else if (month == "June" || month == "September")
- {
- if (nights < 7)
- {
- priceStudio = (nights * 75.2);
- priceApartment = (nights * 68.7);
- }
- else if (7 <= nights && nights <= 14)
- {
- priceStudio = (nights * 75.2);
- priceApartment = (nights * 68.7);
- }
- else
- {
- priceStudio = (nights * 75.2) * 0.8;
- priceApartment = (nights * 68.7) * 0.9;
- }
- }
- else if (month == "July" || month == "August")
- {
- if (nights < 7)
- {
- priceStudio = (nights * 76);
- priceApartment = (nights * 77);
- }
- else if (7 <= nights && nights <= 14)
- {
- priceStudio = (nights * 76);
- priceApartment = (nights * 77);
- }
- else
- {
- priceStudio = (nights * 76);
- priceApartment = (nights * 77) * 0.9;
- }
- }
- Console.WriteLine($"Apartment: {priceApartment:F2} lv.");
- Console.WriteLine($"Studio: {priceStudio:F2} lv.");
- }
- }
- }
Add Comment
Please, Sign In to add comment