Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03._Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numOfPeople = int.Parse(Console.ReadLine());
- string typeOfGroup = Console.ReadLine().ToLower();
- string dayOfWeek = Console.ReadLine().ToLower();
- decimal price = 0;
- if (typeOfGroup == "students")
- {
- switch (dayOfWeek)
- {
- case "friday":
- price = 8.45M;
- break;
- case "saturday":
- price = 9.8M;
- break;
- case "sunday":
- price = 10.46M;
- break;
- }
- if (numOfPeople >= 30)
- {
- price *= 0.85M;
- }
- }
- else if (typeOfGroup == "business")
- {
- switch (dayOfWeek)
- {
- case "friday":
- price = 10.9M;
- break;
- case "saturday":
- price = 15.6M;
- break;
- case "sunday":
- price = 16;
- break;
- }
- if (numOfPeople >= 100)
- {
- price *= 0.9M;
- }
- }
- else if (typeOfGroup == "regular")
- {
- switch (dayOfWeek)
- {
- case "friday":
- price = 15;
- break;
- case "saturday":
- price = 20;
- break;
- case "sunday":
- price = 22.5M;
- break;
- }
- if (numOfPeople >= 10 && numOfPeople <= 20)
- {
- price *= 0.95M;
- }
- }
- decimal totalPrice = numOfPeople * price;
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement