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 peopleCount = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string weekDay = Console.ReadLine();
- double pricePerPerson = 0;
- double total = 0;
- switch (groupType)
- {
- case "Students":
- switch (weekDay)
- {
- case "Friday":
- pricePerPerson = 8.45;
- break;
- case "Saturday":
- pricePerPerson = 9.80;
- break;
- case "Sunday":
- pricePerPerson = 10.46;
- break;
- }
- break;
- case "Business":
- switch (weekDay)
- {
- case "Friday":
- pricePerPerson = 10.90;
- break;
- case "Saturday":
- pricePerPerson = 15.60;
- break;
- case "Sunday":
- pricePerPerson = 16;
- break;
- }
- break;
- case "Regular":
- switch (weekDay)
- {
- case "Friday":
- pricePerPerson = 15;
- break;
- case "Saturday":
- pricePerPerson = 20;
- break;
- case "Sunday":
- pricePerPerson = 22.50;
- break;
- }
- break;
- }
- total = peopleCount * pricePerPerson;
- if (groupType == "Students" && peopleCount >= 30)
- {
- total *= 0.85;
- }
- else if (groupType == "Business" && peopleCount >= 100)
- {
- peopleCount -= 10;
- }
- else if (groupType == "Regular" && peopleCount >= 10 && peopleCount <= 20)
- {
- total *= 0.95;
- }
- Console.WriteLine($"Total price: {total:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement