Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _3._Vacation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int group = int.Parse(Console.ReadLine());
- string groupType = Console.ReadLine();
- string dayOfWeek = Console.ReadLine();
- double totalPrice = 0.00;
- switch (dayOfWeek)
- {
- case "Friday":
- switch (groupType)
- {
- case "Students":
- totalPrice = group * 8.45;
- break;
- case "Business":
- totalPrice = group * 10.90;
- break;
- case "Regular":
- totalPrice = group * 15;
- break;
- }
- break;
- case "Saturday":
- switch (groupType)
- {
- case "Students":
- totalPrice = group * 9.80;
- break;
- case "Business":
- totalPrice = group * 15.60;
- break;
- case "Regular":
- totalPrice = group * 20;
- break;
- }
- break;
- case "Sunday":
- switch (groupType)
- {
- case "Students":
- totalPrice = group * 10.46;
- break;
- case "Business":
- totalPrice = group * 16;
- break;
- case "Regular":
- totalPrice = group * 22.50;
- break;
- }
- break;
- }
- if (groupType == "Students" && group >= 30)
- {
- totalPrice = totalPrice - totalPrice * 0.15;
- }
- else if (groupType == "Business" && group >= 100)
- {
- if (dayOfWeek == "Friday")
- {
- totalPrice = totalPrice - 10 * 10.90;
- }
- else if (dayOfWeek == "Saturday")
- {
- totalPrice = totalPrice - 10 * 15.60;
- }
- else if (dayOfWeek == "Sunday")
- {
- totalPrice = totalPrice - 10 * 16;
- }
- }
- else if (groupType == "Regular" && group >= 10 && group <= 20)
- {
- totalPrice = totalPrice - totalPrice * 0.05;
- }
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement