Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practicing
- {
- class Program
- {
- static void Main(string[] args)
- {
- string season = Console.ReadLine();
- string typeOfGroup = Console.ReadLine();
- int quantityOfStunents = int.Parse(Console.ReadLine());
- int nights = int.Parse(Console.ReadLine());
- double pricePerNight = 0;
- string sport = "null";
- switch (season)
- {
- case "Winter":
- switch (typeOfGroup)
- {
- case "girls":
- pricePerNight = 9.60;
- sport = "Gymnastics";
- break;
- case "boys":
- pricePerNight = 9.60;
- sport = "Judo";
- break;
- case "mixed":
- pricePerNight = 10;
- sport = "Mixed";
- break;
- }
- break;
- case "Spring":
- switch (typeOfGroup)
- {
- case "girls":
- pricePerNight = 7.20;
- sport = "Athletics";
- break;
- case "boys":
- pricePerNight = 7.20;
- sport = "Tennis";
- break;
- case "mixed":
- pricePerNight = 9.50;
- sport = "Cycling";
- break;
- }
- break;
- case "Summer":
- switch (typeOfGroup)
- {
- case "girls":
- pricePerNight = 15;
- sport = "Volleyball";
- break;
- case "boys":
- pricePerNight = 15;
- sport = "Football";
- break;
- case "mixed":
- pricePerNight = 20;
- sport = "Swimming";
- break;
- }
- break;
- }
- var totalPrice = quantityOfStunents * pricePerNight * nights;
- if (quantityOfStunents >= 50)
- totalPrice *= 0.50;
- if (quantityOfStunents < 50 && quantityOfStunents >= 20)
- totalPrice *= 0.85;
- if (quantityOfStunents < 20 && quantityOfStunents >= 10)
- totalPrice *= 0.95;
- Console.WriteLine($"{sport} {totalPrice:f2} lv.");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement