Advertisement
Guest User

Untitled

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