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