Advertisement
MartinZarev

Untitled

Jan 16th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.91 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Theatre_Promotions
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string type = Console.ReadLine();
  10.             int age = int.Parse(Console.ReadLine());
  11.             int sum = 0;
  12.            
  13.  
  14.             if (type=="Weekday")
  15.             {
  16.                
  17.                 if ((age > 0 && age <= 18) || (age > 64 && age <= 122))
  18.                 {
  19.                     sum += 12;
  20.                 }
  21.                 else if (age>18 && age<=64)
  22.                 {
  23.                     sum += 18;
  24.                 }
  25.                 else
  26.                 {
  27.                     Console.WriteLine("Error!");
  28.                 }
  29.             }
  30.             else if (type=="Weekend")
  31.             {
  32.                 if ((age > 0 && age <= 18) || (age > 64 && age <= 122))
  33.                 {
  34.                     sum += 15;
  35.                 }
  36.                 else if (age > 18 && age <= 64)
  37.                 {
  38.                     sum += 20;
  39.                 }
  40.                 else
  41.                 {
  42.                     Console.WriteLine("Error!");
  43.                 }
  44.             }
  45.             else if (type=="Holiday")
  46.             {
  47.                 if (age>0 && age<=18)
  48.                 {
  49.                     sum += 5;
  50.                 }
  51.                 else if (age>18 && age<=64)
  52.                 {
  53.                     sum += 12;
  54.                 }
  55.                 else if (age>64&& age<=122)
  56.                 {
  57.                     sum += 10;
  58.                 }
  59.                 else
  60.                 {
  61.                     Console.WriteLine("Error!");  
  62.                 }
  63.             }
  64.             else
  65.             {
  66.                 Console.WriteLine("Error!");
  67.                
  68.             }
  69.  
  70.             if (sum!=0)
  71.             {
  72.                 Console.WriteLine($"{sum}$");
  73.             }
  74.            
  75.  
  76.            
  77.  
  78.  
  79.  
  80.  
  81.         }
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement