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 ExamHotelRoom
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int stay = int.Parse(Console.ReadLine());
- double fullStayApartment = 0.0;
- double fullStayStudio = 0.0;
- double apartmentPrice = 0.0;
- double studioPrice = 0.0;
- if (month=="May" || month=="October")
- {
- studioPrice = 50;
- apartmentPrice = 65;
- if (stay>7&&stay<14)
- {
- studioPrice -= 0.05 * studioPrice;
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- else if (stay>14)
- {
- studioPrice -= 0.30 * studioPrice;
- apartmentPrice -= 0.10 * apartmentPrice;
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- else
- {
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- }
- else if (month=="June" || month=="September")
- {
- studioPrice = 75.20;
- apartmentPrice = 68.70;
- if (stay>14)
- {
- studioPrice -= 0.20 * studioPrice;
- apartmentPrice -= 0.10 * apartmentPrice;
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- else
- {
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- }
- else if (month=="July" || month=="August")
- {
- apartmentPrice = 77;
- studioPrice = 76;
- if (stay>14)
- {
- apartmentPrice -= 0.10 * apartmentPrice;
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- else
- {
- fullStayApartment = stay * apartmentPrice;
- fullStayStudio = stay * studioPrice;
- Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
- Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement