Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04Problem_Hotel
- {
- class Hotel
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nightCount = int.Parse(Console.ReadLine());
- decimal studioRoom = 0;
- decimal doubleRoom = 0;
- decimal suite = 0;
- decimal freeNight = 0;
- if (month.Equals("May") || month.Equals("October"))
- {
- studioRoom += 50.0m;
- doubleRoom += 65.0m;
- suite += 75.0m;
- if (nightCount > 7)
- {
- studioRoom -= (studioRoom * 0.05m);
- }
- studioRoom *= nightCount;
- doubleRoom *= nightCount;
- suite *= nightCount;
- if (month.Equals("October"))
- {
- freeNight = nightCount / 7;
- studioRoom -= (freeNight * 47.5m);
- }
- }
- else if (month.Equals("June") || month.Equals("September"))
- {
- studioRoom += 60.0m;
- doubleRoom += 72.0m;
- suite += 82.0m;
- if (nightCount > 14)
- {
- doubleRoom -= (doubleRoom * 0.10m);
- }
- studioRoom *= nightCount;
- doubleRoom *= nightCount;
- suite *= nightCount;
- if (month.Equals("September"))
- {
- freeNight = nightCount / 7;
- studioRoom -= (freeNight * 60.0m);
- }
- }
- else if (month.Equals("July") || month.Equals("August") || month.Equals("December"))
- {
- studioRoom += 68.0m;
- doubleRoom +=77.0m;
- suite += 89.0m;
- if (nightCount > 14)
- {
- suite -= (suite * 0.15m);
- }
- studioRoom *= nightCount;
- doubleRoom *= nightCount;
- suite *= nightCount;
- }
- Console.WriteLine("Studio: {0:f2} lv.", studioRoom);
- Console.WriteLine("Double: {0:f2} lv.", doubleRoom);
- Console.WriteLine("Suite: {0:f2} lv.", suite);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement