Guest User

Untitled

a guest
May 22nd, 2021
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.25 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  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.  
  15.             string sport = "";
  16.             if (season == "Winter")
  17.             {
  18.                 if (group == "boys")
  19.                 {
  20.                     decimal pricePerNights = countStudents * 9.60m * nights;
  21.                     price = pricePerNights;
  22.                     sport = "Judo";
  23.                 }
  24.                 else if (group == "girls")
  25.                 {
  26.                     decimal pricePerNights = countStudents * 9.60m * nights;
  27.                     price = pricePerNights;
  28.                     sport = "Gymnastics";
  29.                 }
  30.                 else if (group == "mixed")
  31.                 {
  32.                     decimal pricePerNights = countStudents * 10.00m * nights;
  33.                     price = pricePerNights;
  34.                     sport = "Ski";
  35.                 }
  36.             }
  37.             else if (season == "Spring")
  38.             {
  39.                 if (group == "boys")
  40.                 {
  41.                     decimal pricePerNights = countStudents * 7.20m * nights;
  42.                     price = pricePerNights;
  43.                     sport = "Tennis";
  44.                 }
  45.                 else if (group == "girls")
  46.                 {
  47.                     decimal pricePerNights = countStudents * 7.20m * nights;
  48.                     price = pricePerNights;
  49.                     sport = "Athletics";
  50.                 }
  51.                 if (group == "mixed")
  52.                 {
  53.                     decimal pricePerNights = countStudents * 9.50m * nights;
  54.                     price = pricePerNights;
  55.                     sport = "Cycling";
  56.  
  57.                 }
  58.             }
  59.             if (season == "Summer")
  60.             {
  61.                 if (group == "boys")
  62.                 {
  63.                     decimal pricePerNights = countStudents * 15m * nights;
  64.                     price = pricePerNights;
  65.                     sport = "Football";
  66.                 }
  67.                 else if (group == "girls")
  68.                 {
  69.                     decimal pricePerNights = countStudents * 15m * nights;
  70.                     price = pricePerNights;
  71.                     sport = "Volleyball";
  72.                 }
  73.                 else if (group == "mixed")
  74.                 {
  75.                     decimal pricePerNights = countStudents * 20m * nights;
  76.                     price = pricePerNights;
  77.                     sport = "Swimming";
  78.                 }
  79.             }
  80.  
  81.             int pricePrecAfterDisc = 100;
  82.             if (countStudents >= 50)
  83.             {
  84.                 pricePrecAfterDisc = 50;
  85.             }
  86.             else if (countStudents >= 20)
  87.             {
  88.                 pricePrecAfterDisc = 85;
  89.             }
  90.             else if (countStudents >= 10)
  91.             {
  92.                 pricePrecAfterDisc = 95;
  93.             }
  94.  
  95.             decimal finalPrice = price * pricePrecAfterDisc / 100;
  96.             Console.WriteLine($"{sport} {finalPrice:f2} lv.");
  97.         }
  98.     }
  99. }
  100.  
Advertisement
Add Comment
Please, Sign In to add comment