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 ConsoleApp9
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double studio = 0;
- double doubleRoom = 0;
- double suite = 0;
- if (month.Equals("May") || month.Equals("October"))
- {
- studio = 50;
- doubleRoom = 65;
- suite = 75;
- if (nights > 7)
- {
- studio = studio - (studio * 0.05);
- }
- } else if (month.Equals("June") || month.Equals("September"))
- {
- studio = 60;
- doubleRoom = 72;
- suite = 82;
- if ( nights > 14)
- {
- doubleRoom = doubleRoom - (doubleRoom * 0.10);
- }
- } else if (month.Equals("July") || month.Equals("August") || month.Equals("December"))
- {
- studio = 68;
- doubleRoom = 77;
- suite = 89;
- if (nights > 14)
- {
- suite = suite - (suite * 0.15);
- }
- }
- double studioTotalPrice = nights * studio;
- double doubleRoomTotalPrice = doubleRoom * nights;
- double suiteTotalPrice = suite * nights;
- if (month.Equals("October") && nights > 7 || month.Equals("September") && nights > 7)
- {
- // one night is free
- studioTotalPrice = studioTotalPrice - studio;
- }
- Console.WriteLine($"Studio: {studioTotalPrice:F2} lv.");
- Console.WriteLine($"Double: {doubleRoomTotalPrice:F2} lv.");
- Console.WriteLine($"Suite: {suiteTotalPrice:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment