Advertisement
Guest User

Untitled

a guest
Jun 15th, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.98 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 Sezon = Console.ReadLine();
  14.             string VidNaGrupa = Console.ReadLine();
  15.             int BroiUchenici = int.Parse(Console.ReadLine());
  16.             int BroiNoshtuvki = int.Parse(Console.ReadLine());
  17.  
  18.             var ZimnaMm = 9.60;                 //Cena za Noshtuvka
  19.             var ProletnaMm = 7.20;
  20.             var LqtnaMm = 15;
  21.             var ZimnaSmesena = 10;
  22.             var ProletnaSmesena = 9.50;
  23.             var LqtnaSmesena = 20;
  24.  
  25.  
  26.             double coef = 0.0;
  27.             String prefix = "";
  28.  
  29.  
  30.             if (Sezon.Equals("Winter"))
  31.             {
  32.                 if (VidNaGrupa.Equals("boys"))
  33.                 {
  34.                     coef = ZimnaMm;
  35.                     prefix = "Judo";
  36.                 }
  37.                 else if (VidNaGrupa.Equals("girls"))
  38.                 {
  39.                     coef = ZimnaMm;
  40.                     prefix = "Gymnastics";
  41.                 }
  42.                 else if (VidNaGrupa.Equals("mixed"))
  43.                 {
  44.                     coef = ZimnaSmesena;
  45.                     prefix = "Ski";
  46.                 }
  47.             }
  48.             if (Sezon.Equals("Spring"))
  49.             {
  50.                 if (VidNaGrupa.Equals("boys"))
  51.                 {
  52.                     coef = ProletnaMm;
  53.                     prefix = "Tennis";
  54.                 }
  55.                 else if (VidNaGrupa.Equals("girls"))
  56.                 {
  57.                     coef = ProletnaMm;
  58.                     prefix = "Athletics";
  59.                 }
  60.                 else if (VidNaGrupa.Equals("mixed"))
  61.                 {
  62.                     coef = ProletnaSmesena;
  63.                     prefix = "Cycling";
  64.                 }
  65.             }
  66.             if (Sezon.Equals("Summer"))
  67.             {
  68.                 if (VidNaGrupa.Equals("boys"))
  69.                 {
  70.                     coef = LqtnaMm;
  71.                     prefix = "Football";
  72.                 }
  73.                 else if (VidNaGrupa.Equals("girls"))
  74.                 {
  75.                     coef = LqtnaMm;
  76.                     prefix = "Volleyball";
  77.                 }
  78.                 else if (VidNaGrupa.Equals("mixed"))
  79.                 {
  80.                     coef = LqtnaSmesena;
  81.                     prefix = "Swimming";
  82.                 }
  83.             }
  84.  
  85.             double CenaNaNoshtuvkite = BroiUchenici * BroiNoshtuvki * coef;
  86.             if (BroiUchenici >= 50)
  87.             {
  88.                 CenaNaNoshtuvkite *= 0.50;
  89.             }
  90.             else if (BroiUchenici >= 20)
  91.             {
  92.                 CenaNaNoshtuvkite *= 0.85;
  93.             }
  94.             else if (BroiUchenici >= 10)
  95.             {
  96.                 CenaNaNoshtuvkite *= 0.95;
  97.             }
  98.  
  99.             Console.WriteLine($"{prefix} {CenaNaNoshtuvkite:f2} lv.");
  100.  
  101.         }
  102.     }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement