Guest User

Untitled

a guest
Nov 18th, 2023
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.95 KB | None | 0 0
  1. namespace ConsoleApp9
  2. {
  3.     internal class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             string month = Console.ReadLine();
  8.             int stay = int.Parse(Console.ReadLine());
  9.             double totalCostStudio = 0;
  10.             double totalCostApart = 0;
  11.             if (stay > 200)
  12.             {
  13.  
  14.             }
  15.             if (month == "May" || month == "October")
  16.             {
  17.                 if (stay > 7 && stay <= 14)
  18.                 {
  19.                     totalCostApart = stay * 65;
  20.                     totalCostStudio = (stay * 50) * 0.95;
  21.                 }
  22.                 else if (stay > 14)
  23.                 {
  24.                     totalCostApart = (stay * 65) * 0.9;
  25.                     totalCostStudio = (stay * 50) * 0.7;
  26.                 }
  27.                 else
  28.                 {
  29.                     totalCostApart = stay * 65;
  30.                     totalCostStudio = stay * 50;
  31.                 }
  32.             }
  33.             if (month == "June" || month == "September")
  34.             {
  35.                 if (stay > 14)
  36.                 {
  37.                     totalCostApart = (stay * 68.7) * 0.9;
  38.                     totalCostStudio = (stay * 75.2) * 0.8;
  39.                 }
  40.                 else
  41.                 {
  42.                     totalCostApart = stay * 68.7;
  43.                     totalCostStudio = stay * 75.2;
  44.                 }
  45.             }
  46.             if (month == "July" || month == "August")
  47.             {
  48.                 totalCostStudio = stay * 76;
  49.                 if (stay > 14)
  50.                 {
  51.                     totalCostApart = (stay * 77) * 0.9;
  52.                 }
  53.                 else
  54.                 {
  55.                     totalCostApart = stay * 77;
  56.                 }
  57.             }
  58.             else
  59.             {
  60.  
  61.             }
  62.             Console.WriteLine($"Apartment: {totalCostApart:f2} lv.");
  63.             Console.WriteLine($"Studio: {totalCostStudio:f2} lv.");
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment