Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace School_Camp
- {
- class Program
- {
- static void Main(string[] args)
- {
- string season = Console.ReadLine();
- string group = Console.ReadLine();
- int countStudents = int.Parse(Console.ReadLine());
- int nights = int.Parse(Console.ReadLine());
- decimal price = 0;
- decimal pricePerNights = 0;
- string sport = "";
- if (season == "Winter")
- {
- if (group == "boys")
- {
- pricePerNights = countStudents * 9.60m * nights;
- price = pricePerNights;
- sport = "Judo";
- }
- else if (group == "girls")
- {
- pricePerNights = countStudents * 9.60m * nights;
- price = pricePerNights;
- sport = "Gymnastics";
- }
- else if (group == "mixed")
- {
- pricePerNights = countStudents * 10.00m * nights;
- price = pricePerNights;
- sport = "Ski";
- }
- }
- else if (season == "Spring")
- {
- if (group == "boys")
- {
- pricePerNights = countStudents * 7.20m * nights;
- if (countStudents >= 20)
- {
- price = pricePerNights - (0.15m * pricePerNights);
- sport = "Tennis";
- }
- }
- else if (group == "girls")
- {
- pricePerNights = countStudents * 7.20m * nights;
- price = pricePerNights - (0.15m * pricePerNights);
- sport = "Athletics";
- }
- if (group == "mixed")
- {
- pricePerNights = countStudents * 9.50m * nights;
- price = pricePerNights - (0.05m * pricePerNights);
- sport = "Cycling";
- }
- }
- if (season == "Summer")
- {
- if (group == "boys")
- {
- pricePerNights = countStudents * 15m * nights;
- if (countStudents >= 50)
- {
- price = pricePerNights - (0.50m * pricePerNights);
- sport = "Football";
- }
- }
- else if (group == "girls")
- {
- pricePerNights = countStudents * 15m * nights;
- price = pricePerNights - (0.15m * pricePerNights);
- sport = "Volleyball";
- }
- }
- if (countStudents >= 50)
- {
- price = pricePerNights - (0.50m * pricePerNights);
- }
- else if (countStudents >= 20 && countStudents < 50)
- {
- price = pricePerNights - (0.15m * pricePerNights);
- }
- else if (countStudents >= 10 && countStudents < 20)
- {
- price = pricePerNights - (0.05m * pricePerNights);
- }
- Console.WriteLine($"{sport} {price:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement