Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.Design;
- using System.Globalization;
- using System.Reflection;
- using System.Runtime.ConstrainedExecution;
- using System.Security.Cryptography;
- namespace SomeExcercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- double priceForStudio = 0;
- double priceForApartment = 0;
- string month = Console.ReadLine();
- int sleeps = int.Parse(Console.ReadLine());
- switch (month)
- {
- case "May":
- case "October":
- priceForStudio = sleeps * 50;
- priceForApartment = sleeps * 65;
- if (sleeps > 7 && sleeps <= 14)
- {
- priceForStudio -= priceForStudio * 0.05;
- }
- else if (sleeps > 14)
- {
- priceForStudio -= priceForStudio * 0.30;
- priceForApartment -= priceForApartment * 0.10;
- }
- break;
- case "June":
- case "September":
- priceForStudio = sleeps * 75.20;
- priceForApartment = sleeps * 68.70;
- if (sleeps > 14)
- {
- priceForStudio -= priceForStudio * 0.20;
- priceForApartment -= priceForApartment * 0.10;
- }
- break;
- case "July":
- case "August":
- priceForStudio = sleeps * 76;
- priceForApartment = sleeps * 77;
- priceForApartment -= priceForApartment * 0.10;
- break;
- }
- Console.WriteLine($"Apartment: {priceForApartment:f2} lv.");
- Console.WriteLine($"Studio: {priceForStudio:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment