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 volume = int.Parse(Console.ReadLine());
- string kind = Console.ReadLine();
- string day = Console.ReadLine();
- double sum = 0;
- if (day == "Friday")
- {
- switch (kind)
- {
- case "Students":
- sum = volume * 8.45;
- if (volume >= 30)
- {
- sum *= 0.85;
- }
- break;
- case "Business":
- if (volume >= 100)
- {
- volume -= 10;
- }
- sum = volume * 10.9;
- break;
- case "Regular":
- sum = volume * 15;
- if (volume >= 10 && volume <= 20)
- {
- sum *= 0.95;
- }
- break;
- }
- }
- else if (day == "Saturday")
- {
- switch (kind)
- {
- case "Students":
- sum = volume * 9.8;
- if (volume >= 30)
- {
- sum *= 0.85;
- }
- break;
- case "Business":
- ;
- if (volume >= 100)
- {
- volume -= 10;
- }
- sum = volume * 15.6;
- break;
- case "Regular":
- sum = volume * 20;
- if (volume >= 10 && volume <= 20)
- {
- sum *= 0.95;
- }
- break;
- }
- }
- else if (day == "Sunday")
- {
- switch (kind)
- {
- case "Students":
- sum = volume * 10.46;
- if (volume >= 30)
- {
- sum *= 0.85;
- }
- break;
- case "Business":
- if (volume >= 100)
- {
- volume -= 10;
- }
- sum = volume * 16;
- break;
- case "Regular":
- sum = volume * 22.5;
- if (volume >= 10 && volume <= 20)
- {
- sum *= 0.95;
- }
- break;
- }
- }
- Console.WriteLine($"Total price: {sum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement