Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Default
- {
- class Program
- {
- static void Main(string[] args)
- {
- string day = Console.ReadLine();
- int age = int.Parse(Console.ReadLine());
- int ticketPrice = 0;
- if (day == "Weekday")
- {
- if (0 <= age && age <= 18)
- {
- ticketPrice = 12;
- }
- else if (18 <= age && age <= 64)
- {
- ticketPrice = 18;
- }
- else if (64 <= age && age <= 122)
- {
- ticketPrice = 12;
- }
- }
- if (day == "Weekend")
- {
- if (0 <= age && age <= 18)
- {
- ticketPrice = 15;
- }
- else if (18 <= age && age <= 64)
- {
- ticketPrice = 20;
- }
- else if (64 <= age && age <= 122)
- {
- ticketPrice = 15;
- }
- }
- if (day == "Holiday")
- {
- if (0 <= age && age <= 18)
- {
- ticketPrice = 5;
- }
- else if (18 <= age && age <= 64)
- {
- ticketPrice = 12;
- }
- else if (64 <= age && age <= 122)
- {
- ticketPrice = 10;
- }
- }
- if (ticketPrice != 0)
- {
- Console.WriteLine(ticketPrice + "$");
- }
- else
- {
- Console.WriteLine("Error!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement