Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.CompilerServices;
- using System.Threading;
- namespace demo
- {
- class Program
- {
- static void Main()
- {
- int people = int.Parse(Console.ReadLine());
- string typeGroup = Console.ReadLine();
- string day = Console.ReadLine();
- decimal total = 0.00m;
- if (typeGroup == "Business" && people >= 100)
- {
- people -= 10;
- }
- if (day == "Friday")
- {
- if (typeGroup == "Students")
- {
- total = people * 8.45m;
- }
- else if (typeGroup == "Business")
- {
- total = people * 10.90m;
- }
- else if (typeGroup == "Regular")
- {
- total = people * 15.00m;
- }
- }
- else if (day == "Saturday")
- {
- if (typeGroup == "Students")
- {
- total = people * 9.80m;
- }
- else if (typeGroup == "Business")
- {
- total = people * 15.60m;
- }
- else if (typeGroup == "Regular")
- {
- total = people * 20.00m;
- }
- }
- else if (day == "Sunday")
- {
- if (typeGroup == "Students")
- {
- total = people * 10.46m;
- }
- else if (typeGroup == "Business")
- {
- total = people * 16.00m;
- }
- else if (typeGroup == "Regular")
- {
- total = people * 22.50m;
- }
- }
- if (typeGroup == "Students" && people >= 30)
- {
- total *= 0.85m;
- }
- bool checkNumberOfRegulars = 10 <= people && people <= 20;
- if (typeGroup == "Regular" && checkNumberOfRegulars)
- {
- total *= 0.95m;
- }
- Console.WriteLine($"Total price: {total:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment