Anzzhhela98

ф

Jun 4th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3.  
  4. namespace kiki2
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double buget = double.Parse(Console.ReadLine());
  11.             string season = Console.ReadLine();
  12.             double count = double.Parse(Console.ReadLine());
  13.             double boatPrice = 0;
  14.             double totalBoatPrice = 0;
  15.             double moneyLeft = 0;
  16.             double moneyNeed = 0;
  17.             if (season == "Spring")
  18.             {
  19.                 boatPrice = 3000;
  20.             }
  21.             else if (season=="Summer"||season=="Autumn")
  22.             {
  23.                 boatPrice = 4200;
  24.             }
  25.             else if (season=="Winter")
  26.             {
  27.                 boatPrice = 2600;
  28.  
  29.             }
  30.             if (count<=6)
  31.             {
  32.                 totalBoatPrice =boatPrice* 0.90;
  33.             }
  34.             else if (count>=7 && count <=11)
  35.             {
  36.                totalBoatPrice =boatPrice* 0.85;
  37.             }
  38.             else if (count >12)
  39.             {
  40.                 totalBoatPrice =boatPrice* 0.75;
  41.             }
  42.             if ((count % 2 == 0) && (season == "Spring" || season == "Summer" || season == "Winter"))
  43.             {
  44.                 totalBoatPrice = totalBoatPrice * 0.95;
  45.             }
  46.             if (buget>=totalBoatPrice)
  47.             {
  48.                  moneyLeft = buget - totalBoatPrice;
  49.                 Console.WriteLine($" Yes! You have {moneyLeft:f2} leva left.");
  50.             }
  51.             else if (buget<=boatPrice)
  52.             {
  53.                  moneyNeed = totalBoatPrice - buget;
  54.                 Console.WriteLine($" Not enough money! You need {moneyNeed:f2} leva.");
  55.             }
  56.            
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment