Advertisement
YavorGrancharov

Theatre_Promotion

May 27th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Theatre_Promotion
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string day = Console.ReadLine();
  14.             var age = int.Parse(Console.ReadLine());
  15.  
  16.             if (day.Equals("Weekday"))
  17.             {
  18.                 if (age >= 0 && age <= 18 || age > 64 && age <= 122)
  19.                 {
  20.                     Console.WriteLine("12$");
  21.                 }
  22.                 else if (age > 18 && age <= 64)
  23.                 {
  24.                     Console.WriteLine("18$");
  25.                 }
  26.                 else
  27.                 {
  28.                     Console.WriteLine("Error!");
  29.                 }
  30.             }
  31.             if(day.Equals("Weekend"))
  32.             {
  33.                 if (age >= 0 && age <= 18 || age > 64 && age <= 122)
  34.                 {
  35.                     Console.WriteLine("15$");
  36.                 }
  37.                 else if (age > 18 && age <= 64)
  38.                 {
  39.                     Console.WriteLine("20$");
  40.                 }
  41.                 else
  42.                 {
  43.                     Console.WriteLine("Error!");
  44.                 }
  45.             }
  46.             if(day.Equals("Holiday"))
  47.             {
  48.                 if (age >= 0 && age <= 18)
  49.                 {
  50.                     Console.WriteLine("5$");
  51.                 }
  52.                 else if (age > 18 && age <= 64)
  53.                 {
  54.                     Console.WriteLine("12$");
  55.                 }
  56.                 else if(age > 64 && age <= 122)
  57.                 {
  58.                     Console.WriteLine("10$");
  59.                 }
  60.                 else
  61.                 {
  62.                     Console.WriteLine("Error!");
  63.                 }
  64.             }
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement