Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _7.Theatre_Promotions
- {
- class Program
- {
- static void Main(string[] args)
- {
- string KindDay = Console.ReadLine().ToLower();
- int Age = int.Parse(Console.ReadLine());
- double price = 0;
- switch(KindDay)
- {
- case "weekday":
- if ((Age >= 0 && Age <= 18) || (Age > 64 && Age <= 122))
- {
- price = 12;
- }
- else if (Age > 18 && Age <= 64)
- {
- price = 18;
- }
- break;
- case "weekend":
- if ((Age >= 0 && Age <= 18)|| (Age > 64 && Age <= 122))
- {
- price = 15;
- }
- else if (Age > 18 && Age <= 64)
- {
- price = 20;
- }
- break;
- case "holiday":
- if (Age >= 0 && Age <= 18)
- {
- price = 5;
- }
- else if (Age > 18 && Age <= 64)
- {
- price = 12;
- }
- else if (Age > 64 && Age <= 122)
- {
- price = 10;
- }
- break;
- }
- if (Age >= 0 && Age <= 122)
- {
- Console.WriteLine($"{price}$");
- }
- else
- {
- Console.WriteLine("Error!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement