madeofglass

Untitled

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