Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ВложениЦиклиУпр_задача_8
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double nightInStudio = 0;
- double nightInApartment = 0;
- double totalCost1 = nightInApartment * nights;
- double totalCost2 = nightInStudio * nights;
- if (month == "May" || month == "Octomber")
- {
- nightInStudio = 50;
- nightInApartment = 65;
- if (nights > 7 && nights <= 14)
- {
- totalCost2 = nightInStudio * nights;
- totalCost2 *= 0.95;
- }
- else if (nights > 14)
- {
- totalCost1 = nightInApartment * nights;
- totalCost2 = nightInStudio * nights;
- totalCost2 *= 0.70;
- totalCost1 *= 0.90;
- }
- else if (nights < 7)
- {
- totalCost1 = nightInApartment * nights;
- totalCost2 = nightInStudio * nights;
- }
- }
- else if (month == "June" || month == "September")
- {
- nightInStudio = 75.20;
- nightInApartment = 68.70;
- if (nights <= 14)
- {
- totalCost2 = nightInStudio * nights;
- totalCost1 = nightInApartment * nights;
- }
- else if (nights > 14)
- {
- totalCost2 = nightInStudio * nights;
- totalCost1 = nightInApartment * nights;
- totalCost2 *= 0.80;
- totalCost1 *= 0.90;
- }
- }
- else if (month == "July" || month == "August")
- {
- nightInStudio = 76;
- nightInApartment = 77;
- if (nights > 14)
- {
- totalCost2 = nightInStudio * nights;
- totalCost1 = nightInApartment * nights;
- totalCost1 *= 0.90;
- }
- else if ( nights <= 14)
- {
- totalCost1 = nightInApartment * nights;
- totalCost2 = nightInStudio * nights;
- }
- }
- Console.WriteLine($"Apartment: {totalCost1:f2} lv.");
- Console.WriteLine($"Studio: {totalCost2:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement