MiroslavKisov

Cinema

Jul 26th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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 Cinema
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double pricePremiere = 12.0d;
  14.             double priceNormal = 7.5d;
  15.             double priceDiscount = 5.0d;
  16.             string type = Console.ReadLine();
  17.             double rows = double.Parse(Console.ReadLine());
  18.             double cols = double.Parse(Console.ReadLine());
  19.             double watchers = rows * cols;
  20.             double price = 0.0d;
  21.             switch (type)
  22.             {
  23.                 case "Premiere":
  24.                      price = watchers * pricePremiere;
  25.                     Console.WriteLine("{0:f2}",price);break;
  26.                 case "Normal":
  27.                      price = watchers * priceNormal;
  28.                     Console.WriteLine("{0:f2}", price); break;
  29.                 case "Discount":
  30.                      price = watchers * priceDiscount;
  31.                     Console.WriteLine("{0:f2}", price); break;
  32.                 default:break;
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment