Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Soft_Uni
- {
- class Program
- {
- static void Main(string[] args)
- {
- int people = int.Parse(Console.ReadLine());
- string type = Console.ReadLine();
- string day = Console.ReadLine();
- decimal price = 0;
- switch (type)
- {
- case "Students":
- switch (day)
- {
- case "Friday":
- price = 8.45M;
- break;
- case "Saturday":
- price = 9.8M;
- break;
- case "Sunday":
- price = 10.46M;
- break;
- }
- break;
- case "Business":
- switch (day)
- {
- case "Friday":
- price = 10.9M;
- break;
- case "Saturday":
- price = 15.6M;
- break;
- case "Sunday":
- price = 16M;
- break;
- }
- break;
- case "Regular":
- switch (day)
- {
- case "Friday":
- price = 15M;
- break;
- case "Saturday":
- price = 20M;
- break;
- case "Sunday":
- price = 22.5M;
- break;
- }
- break;
- }
- decimal totalPrice = price * people;
- if (type == "Students" && people >= 30)
- {
- totalPrice = totalPrice *0.85M;
- }
- if(type == "Business" && people >= 100)
- {
- totalPrice -= people * 10M;
- }
- if(type == "Regular" && people >= 10 && people <= 20)
- {
- totalPrice = totalPrice * 0.95M;
- }
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement