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 ConsoleApp51
- {
- class Program
- {
- static void Main(string[] args)
- {
- string mouth = Console.ReadLine();
- int sleepNights = int.Parse(Console.ReadLine());
- double priceStudio = 0;
- double priceApartment = 0;
- if (mouth == "May" || mouth == "Octomber")
- {
- priceStudio = 50;
- priceApartment = 65;
- if (sleepNights <= 7)
- {
- priceStudio = (priceStudio - 2.5) * sleepNights;
- }
- else if (sleepNights > 14)
- {
- priceStudio = (priceStudio - 15) * sleepNights;
- priceApartment = (priceApartment - 6.5) * sleepNights;
- }
- Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
- Console.WriteLine($"Studio: {priceStudio:f2} lv.");
- }
- else if (mouth == "June" || mouth == "September")
- {
- priceStudio = 75.20;
- priceApartment = 68.70;
- if (sleepNights > 14)
- {
- priceStudio = (priceStudio - 15.04) * sleepNights;
- priceApartment = (priceApartment - 6.87) * sleepNights;
- }
- else if (sleepNights <= 14)
- {
- priceStudio = priceStudio * sleepNights;
- priceApartment = priceApartment * sleepNights;
- }
- Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
- Console.WriteLine($"Studio: {priceStudio:f2} lv.");
- }
- else if (mouth == "July" || mouth == "August")
- {
- priceStudio = 76.00 * sleepNights;
- priceApartment = (77.00 - 7.7) * sleepNights;
- Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
- Console.WriteLine($"Studio: {priceStudio:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement