Advertisement
koksibg

School_Camp

Oct 18th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace School_Camp
  4. {
  5.     class School_Camp
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string seson = Console.ReadLine();
  10.             string groop = Console.ReadLine();
  11.             int students = int.Parse(Console.ReadLine());
  12.             int nights = int.Parse(Console.ReadLine());
  13.             string sport = "";
  14.             double price = 0;
  15.             double totalprice = 0;
  16.             double totalPriceScool = 0;
  17.             if (seson == "Winter")
  18.             {
  19.                 if (groop == "boys")
  20.                 {
  21.                     price = 9.60;
  22.                     sport = "Judo";
  23.                 }
  24.                 if (groop == "girls")
  25.                 {
  26.                     price = 9.60;
  27.                     sport = "Gymnastics";
  28.                 }
  29.                 if (groop == "mixed")
  30.                 {
  31.                     price =  10.00;
  32.                     sport = "Ski";
  33.                 }
  34.                 if (students >= 50)
  35.                 {
  36.                     totalprice = nights * students * price;
  37.                     totalPriceScool = 0.5 * totalprice;
  38.                 }
  39.                 else if (students >= 20 && students < 50)
  40.                 {
  41.                     totalprice = nights * students * price;
  42.                     totalPriceScool = 0.85 * totalprice;
  43.                 }
  44.                 else if (students >= 10 && students < 20)
  45.                 {
  46.                     totalprice = nights * students * price;
  47.                     totalPriceScool = 0.95 * totalprice;
  48.                 }
  49.                 else if (students < 10)
  50.                 {
  51.                     totalprice = nights * students * price;
  52.                     totalPriceScool = totalprice;
  53.                 }
  54.             }
  55.             if (seson == "Spring")
  56.             {
  57.                 if (groop == "boys")
  58.                 {
  59.                     price = 7.20;
  60.                     sport = "Tennis";
  61.                 }
  62.                 if (groop == "girls")
  63.                 {
  64.                     price = 7.20;
  65.                     sport = "Athletics";
  66.                 }
  67.                 if (groop == "mixed")
  68.                 {
  69.                     price = 9.50;
  70.                     sport = "Cycling";
  71.                 }
  72.                 if (students >= 50)
  73.                 {
  74.                     totalprice = nights * students * price;
  75.                     totalPriceScool = 0.5 * totalprice;
  76.                 }
  77.                 else if (students >= 20 && students < 50)
  78.                 {
  79.                     totalprice = nights * students * price;
  80.                     totalPriceScool = 0.85 * totalprice;
  81.                 }
  82.                 else if (students >= 10 && students < 20)
  83.                 {
  84.                     totalprice = nights * students * price;
  85.                     totalPriceScool = 0.95 * totalprice;
  86.                 }
  87.                 else if(students < 10)
  88.                 {
  89.                     totalprice = nights * students * price;
  90.                     totalPriceScool = totalprice;
  91.                 }
  92.             }
  93.             if (seson == "Summer")
  94.             {
  95.                 if (groop == "boys")
  96.                 {
  97.                     price = 15;
  98.                     sport = "Football";
  99.                 }
  100.                 if (groop == "girls")
  101.                 {
  102.                     price = 15;
  103.                     sport = "Volleyball";
  104.                 }
  105.                 if (groop == "mixed")
  106.                 {
  107.                     price = 20;
  108.                     sport = "Swimming";
  109.                 }
  110.                 if (students >= 50)
  111.                 {
  112.                     totalprice = nights * students * price;
  113.                     totalPriceScool = 0.5 * totalprice;
  114.                 }
  115.                 else if (students >= 20 && students < 50)
  116.                 {
  117.                     totalprice = nights * students * price;
  118.                     totalPriceScool = 0.85 * totalprice;
  119.                 }
  120.                 else if (students >= 10 && students < 20)
  121.                 {
  122.                     totalprice = nights * students * price;
  123.                     totalPriceScool = 0.95 * totalprice;
  124.                 }
  125.                 else if (students < 10)
  126.                 {
  127.                     totalprice = nights * students * price;
  128.                     totalPriceScool = totalprice;
  129.                 }
  130.             }
  131.             Console.WriteLine($"{sport} {totalPriceScool:f2} lv.");
  132.  
  133.         }
  134.     }
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement