Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace hotelRoom
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nightsStayed = int.Parse(Console.ReadLine());
- double studioPrice = 0.0;
- double apartamentPrice = 0.0;
- if (month == "May" || month == "October")
- {
- studioPrice = nightsStayed * 50;
- apartamentPrice = nightsStayed * 65;
- if (nightsStayed >= 7 && nightsStayed < 14)
- {
- studioPrice -= studioPrice * 0.05;
- }
- else if (nightsStayed > 14)
- studioPrice -= studioPrice * 0.3;
- }
- else if (month == "June" || month == "September")
- {
- studioPrice = nightsStayed * 75.2;
- if (nightsStayed > 14)
- {
- studioPrice -= studioPrice * 0.2;
- }
- apartamentPrice = nightsStayed * 68.70;
- }
- else if (month == "July" || month == "August")
- {
- studioPrice = nightsStayed * 76;
- apartamentPrice = nightsStayed * 77;
- }
- if (nightsStayed > 14)
- apartamentPrice -= apartamentPrice * 0.1;
- Console.WriteLine($"Apartment: {apartamentPrice:f2} lv.");
- Console.WriteLine($"Studio: {studioPrice:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement