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