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 count = int.Parse(Console.ReadLine());
- string type = Console.ReadLine();
- string dayOfWeek = Console.ReadLine();
- double ticketPrice = 0;
- double totalPrice = 0;
- double discountPercentage = 0;
- if (type == "Students")
- {
- if (dayOfWeek == "Friday")
- {
- ticketPrice = 8.45;
- }
- else if (dayOfWeek == "Saturday")
- {
- ticketPrice = 9.80;
- }
- else if (dayOfWeek == "Sunday")
- {
- ticketPrice = 10.46;
- }
- if (count >= 30)
- {
- totalPrice = totalPrice - totalPrice * 0.85;
- discountPercentage = 15;
- }
- }
- else if (type == "Business")
- {
- if (count >= 100)
- {
- count -= 10;
- }
- if (dayOfWeek == "Friday")
- {
- ticketPrice = 10.90;
- }
- else if (dayOfWeek == "Saturday")
- {
- ticketPrice = 15.60;
- }
- else if (dayOfWeek == "Sunday")
- {
- ticketPrice = 16;
- }
- }
- else if (type == "Regular")
- {
- if (dayOfWeek == "Friday")
- {
- ticketPrice = 15;
- }
- else if (dayOfWeek == "Saturday")
- {
- ticketPrice = 20;
- }
- else if (dayOfWeek == "Sunday")
- {
- ticketPrice = 22.50;
- }
- if (count >= 10 || count <= 20)
- {
- totalPrice = totalPrice - totalPrice * 0.95;
- discountPercentage = 5;
- }
- }
- totalPrice = count * ticketPrice;
- if (discountPercentage != 0)
- {
- totalPrice -= totalPrice * discountPercentage / 100;
- }
- Console.WriteLine($"Total price: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement