Advertisement
Guest User

Fishing Boat

a guest
Jan 22nd, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ages
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.            
  11.             int budget = int.Parse(Console.ReadLine());
  12.             string season = Console.ReadLine();
  13.             int people = int.Parse(Console.ReadLine());
  14.             double price = 0;
  15.  
  16.             if (season == "Spring")
  17.             {
  18.                 if (people <= 6)
  19.                 {
  20.                    
  21.  
  22.                     price = 3000 - (3000 * 0.10);
  23.                 }
  24.                 else if (people >= 7 && people <= 11)
  25.                 {
  26.                    
  27.                     price = 3000 - (3000 * 0.15);
  28.                 }
  29.                 else if (people > 12)
  30.                 {
  31.                    
  32.                     price = 3000 - (3000 * 0.25);
  33.                 }
  34.             }
  35.             else if (season == "Summer")
  36.             {
  37.                 if (people <= 6)
  38.                 {
  39.                    
  40.                 }
  41.                 else if (people >= 7 && people <= 11)
  42.                 {
  43.                    
  44.                     price = 4200 - (4200 * 0.15);
  45.                 }
  46.                 else if (people > 12)
  47.                 {
  48.                    
  49.                     price = 4200 - (4200 * 0.25);
  50.                 }
  51.             }
  52.             else if (season == "Autumn")
  53.             {
  54.                 if (people <= 6)
  55.                 {
  56.  
  57.                     price = 4200 - (4200 * 0.10);
  58.                 }
  59.                 else if (people >= 7 && people <= 11)
  60.                 {
  61.                     price = 4200 - (4200 * 0.15);
  62.                 }
  63.                 else if (people > 12)
  64.                 {
  65.                     price = 4200 - (4200 * 0.25);
  66.                 }
  67.             }
  68.             else if (season == "Winter")
  69.             {
  70.                 if (people <= 6)
  71.                 {
  72.                     price = 2600 - (2600 * 0.10);
  73.                 }
  74.                 else if (people >= 7 && people <= 11)
  75.                 {
  76.                    
  77.                     price = 2600 - (2600 * 0.15);
  78.                 }
  79.                 else if (people > 12)
  80.                 {
  81.                    
  82.                     price = 2600 - (2600 * 0.25);
  83.                 }
  84.             }
  85.             if(people % 2 == 0 && season !="Autumn")
  86.             {
  87.                 price *= 0.05;
  88.             }
  89.  
  90.             if (budget>price)
  91.             {
  92.                 Console.WriteLine($"Yes! You have {budget-price:f2} leva left.");
  93.             }
  94.             else
  95.             {
  96.                 Console.WriteLine($"Not enough money! You need {price-budget:f2} leva.");
  97.             }
  98.  
  99.  
  100.  
  101. }
  102.  
  103. }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement