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 _03.Hotel.Room
- {
- class Program
- {
- static void Main(string[] args)
- {
- var month = Console.ReadLine().ToLower();
- var nightsCount = int.Parse(Console.ReadLine());
- var studioPrice = 0.0;
- var apartmenPrice = 0.0;
- var realPriceStudio = 0.0;
- var realPriceApart = 0.0;
- switch (month)
- {
- case "may":
- case "october":
- if (nightsCount <= 7)
- {
- studioPrice = 50.00 * nightsCount;
- realPriceStudio = studioPrice;
- apartmenPrice = 65.00 * nightsCount;
- realPriceApart = apartmenPrice;
- }
- else if (nightsCount > 7 && nightsCount <= 14)
- {
- studioPrice = 50.00 * nightsCount;
- realPriceStudio = studioPrice - (studioPrice * 0.05);
- apartmenPrice = 65.00 * nightsCount;
- realPriceApart = apartmenPrice;
- }
- else
- {
- studioPrice = 50.00 * nightsCount;
- realPriceStudio = studioPrice - (studioPrice * 0.30);
- apartmenPrice = 65.00 * nightsCount;
- realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
- }
- break;
- case "june":
- case "september":
- if (nightsCount > 14 )
- {
- studioPrice = 75.20 * nightsCount;
- realPriceStudio = studioPrice - (studioPrice * 0.20);
- apartmenPrice = 68.70 * nightsCount;
- realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
- }
- else
- {
- studioPrice = 75.20 * nightsCount;
- realPriceStudio = studioPrice;
- apartmenPrice = 68.70 * nightsCount;
- realPriceApart = apartmenPrice;
- }
- break;
- case "july":
- case "august":
- if (nightsCount > 14)
- {
- studioPrice = 76.00 * nightsCount;
- realPriceStudio = studioPrice;
- apartmenPrice = 77.00 * nightsCount;
- realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
- }
- else
- {
- studioPrice = 76.00 * nightsCount;
- realPriceStudio = studioPrice;
- apartmenPrice = 77.00 * nightsCount;
- realPriceApart = apartmenPrice;
- }
- break;
- }
- Console.WriteLine("Apartment: {0:f2} lv.",realPriceApart);
- Console.WriteLine("Studio: {0:f2} lv.",realPriceStudio);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement