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