Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string mounth = Console.ReadLine(); //May, June, July, August, September или October
- int nights = int.Parse(Console.ReadLine());
- double studioPrice =0;
- double apartamentPrice =0;
- if (mounth == "May" || mounth== "October")
- {
- studioPrice = nights * 50;
- apartamentPrice = nights * 65;
- if (nights > 14)
- {
- apartamentPrice -= apartamentPrice * 0.10;
- studioPrice -= studioPrice * 0.30;
- }
- else if(nights > 7)
- {
- studioPrice -= studioPrice * 0.05;
- }
- }
- else if (mounth =="June" || mounth == "September")
- {
- studioPrice = nights * 75.20;
- apartamentPrice = nights * 68.70;
- if (nights > 14)
- {
- apartamentPrice -= apartamentPrice * 0.10;
- studioPrice -= studioPrice * 0.20;
- }
- }
- else
- {
- studioPrice = nights * 76;
- apartamentPrice = nights * 77;
- if(nights > 14)
- {
- apartamentPrice -= apartamentPrice * 0.10;
- }
- }
- Console.WriteLine($"Apartment: {apartamentPrice:F2} lv.");
- Console.WriteLine($"Studio: {studioPrice:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment