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 count = int.Parse(Console.ReadLine());
- string type = Console.ReadLine();
- string day = Console.ReadLine();
- decimal price = 0;
- if (day == "Friday")
- {
- switch (type)
- {
- case "Students": price = count * 8.45M; break;
- case "Business": price = count * 10.90M; break;
- case "Regular" : price = count * 15.00M; break;
- }
- }
- else if (day == "Saturday")
- {
- switch (type)
- {
- case "Students": price = count * 9.80M; break;
- case "Business": price = count * 15.60M; break;
- case "Regular" : price = count * 20.00M; break;
- }
- }
- else if (day == "Sunday")
- {
- switch (type)
- {
- case "Students": price = count * 10.46M; break;
- case "Business": price = count * 16.00M; break;
- case "Regular" : price = count * 22.50M; break;
- }
- }
- if (type == "Students")
- {
- if (count >= 30 && type == "Students")
- {
- price *= 0.85M;
- Console.WriteLine($"Total price: {price:f2}");
- }
- else
- {
- Console.WriteLine($"Total price: {price:f2}");
- }
- }
- if (type == "Business")
- {
- if (count >= 100 && type == "Business")
- {
- price = price * (count - 10);
- Console.WriteLine($"Total price: {price:f2}");
- }
- else
- {
- Console.WriteLine($"Total price: {price:f2}");
- }
- }
- if (type == "Regular")
- {
- if (count >= 10 && count <= 20 && type == "Regular")
- {
- price *= 0.95M;
- Console.WriteLine($"Total price: {price:f2}");
- }
- else
- {
- Console.WriteLine($"Total price: {price:f2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement