Advertisement
MartinYanchev-99

School Camp

May 29th, 2017
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SchoolCamp
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string season = Console.ReadLine().ToLower();
  14.             string typeGroup = Console.ReadLine().ToLower();
  15.             int students = int.Parse(Console.ReadLine());
  16.             int overnights = int.Parse(Console.ReadLine());
  17.             double price = 0.0;
  18.             string typeSport = "";
  19.             //season if
  20.             if (season == "winter")
  21.             {
  22.                 if (typeGroup== "boys"|| typeGroup=="girls")
  23.                 {
  24.                     price = (students*9.60)*overnights;
  25.                 }
  26.                 else if (typeGroup == "mixed")
  27.                 {
  28.                     price = (students * 10)*overnights;
  29.                 }
  30.             }
  31.             else if (season == "spring")
  32.             {
  33.                 if (typeGroup == "boys" || typeGroup == "girls")
  34.                 {
  35.                     price = (students * 7.20)*overnights;
  36.                 }
  37.                 else if (typeGroup == "mixed")
  38.                 {
  39.                     price = (students * 9.50)*overnights;
  40.                 }
  41.             }
  42.             else if (season == "summer")
  43.             {
  44.                 if (typeGroup == "boys" || typeGroup == "girls")
  45.                 {
  46.                     price = (students * 15)*overnights;
  47.                 }
  48.                 else if (typeGroup == "mixed")
  49.                 {
  50.                     price = (students * 20)*overnights;
  51.                 }
  52.             }
  53.             //price if
  54.             if (students >= 10 && students < 20)
  55.             {
  56.                 price = price - price * 0.05;
  57.             }
  58.             else if (price >= 20 && price< 50)
  59.             {
  60.                 price = price  - price * 0.15;
  61.             }
  62.             else if (students > 50)
  63.             {
  64.                 price = price / 2;
  65.             }
  66.             // sport if
  67.             if (season == "winter")
  68.             {
  69.                 if (typeGroup=="girls")
  70.                 {
  71.                     typeSport = "Gymnastic";
  72.                 }
  73.                 else if (typeGroup == "boys")
  74.                 {
  75.                     typeSport = "Judo";
  76.                 }
  77.                 else if (typeGroup=="mixed")
  78.                 {
  79.                     typeSport = "Ski";
  80.                 }
  81.             }
  82.             else if (season =="spring")
  83.             {
  84.                 if (typeGroup == "girls")
  85.                 {
  86.                     typeSport = "Athletics";
  87.                 }
  88.                 else if (typeGroup == "boys")
  89.                 {
  90.                     typeSport = "Tennis";
  91.                 }
  92.                 else if (typeGroup == "mixed")
  93.                 {
  94.                     typeSport = "Cycling";
  95.                 }
  96.             }
  97.             else if (season == "summer")
  98.             {
  99.                 if (typeGroup == "girls")
  100.                 {
  101.                     typeSport = "Volleyball";
  102.                 }
  103.                 else if (typeGroup == "boys")
  104.                 {
  105.                     typeSport = "Football";
  106.                 }
  107.                 else if (typeGroup == "mixed")
  108.                 {
  109.                     typeSport = "Swimming";
  110.                 }
  111.             }
  112.  
  113.  
  114.             Console.WriteLine($"{typeSport} {price:f2}lv");
  115.  
  116.  
  117.  
  118.  
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement