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 _3.Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int CountPeople = int.Parse(Console.ReadLine());
- string KindGroup = Console.ReadLine();
- string Day = Console.ReadLine();
- double price = 0;
- double TotalSum = 0;
- switch (Day)
- {
- case "Friday":
- switch (KindGroup)
- {
- case "Students":
- price = 8.45;
- break;
- case "Business":
- price = 10.90;
- break;
- case "Regular":
- price = 15.00;
- break;
- }
- break;
- case "Saturday":
- switch (KindGroup)
- {
- case "Students":
- price = 9.80;
- break;
- case "Business":
- price = 15.60;
- break;
- case "Regular":
- price = 20.00;
- break;
- }
- break;
- case "Sunday":
- switch (KindGroup)
- {
- case "Students":
- price = 10.46;
- break;
- case "Business":
- price = 16.00;
- break;
- case "Regular":
- price = 22.50;
- break;
- }
- break;
- }
- TotalSum = price * CountPeople;
- if (KindGroup == "Students" && CountPeople >= 30)
- {
- TotalSum = TotalSum - (TotalSum * 15 / 100);
- }
- if (KindGroup == "Business" && CountPeople >= 100)
- {
- TotalSum = TotalSum - (price * 10);
- }
- if (KindGroup == "Regular" && CountPeople >= 10 && CountPeople <= 20)
- {
- TotalSum = TotalSum - (TotalSum * 5 / 100);
- }
- Console.WriteLine($"Total price: {TotalSum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment