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 hotel_room
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- var nights = double.Parse(Console.ReadLine());
- var Apartment = 1.0;
- var Studio = 1.0;
- if (nights > 14)
- {
- Apartment *= 0.9;
- }
- if ((nights > 14) && ((month == "May") || (month == "October")))
- {
- Studio *= 0.7;
- }
- else if ((nights > 7) && ((month == "May") || (month == "October")))
- {
- Studio *= 0.95;
- }
- if ((nights > 14) && ((month == "June") || (month == "September")))
- {
- Studio *= 0.8;
- }
- switch (month)
- {
- case "May":
- Studio *= nights * 50;
- Apartment *= nights * 65; break;
- case "October":
- Studio *= nights * 50;
- Apartment *= nights * 65; break;
- case "June":
- Studio *= nights * 75.20;
- Apartment *= nights * 68.70; break;
- case "September":
- Studio *= nights * 75.20;
- Apartment *= nights * 68.70; break;
- case "July":
- Studio *= nights * 76;
- Apartment *= nights * 77; break;
- case "August":
- Studio *= nights * 76;
- Apartment *= nights * 77; break;
- }
- Console.WriteLine("Apartment: {0:f2} lv.", Apartment);
- Console.WriteLine("Studio: {0:f2} lv.", Studio);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment