Advertisement
Guest User

cinema

a guest
May 16th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 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.             string typeMovie = Console.ReadLine();
  14.             int r = int.Parse(Console.ReadLine());
  15.             int c = int.Parse(Console.ReadLine());
  16.  
  17.             double price = (0.0);
  18.  
  19.             switch (typeMovie)
  20.             {
  21.                 case "Premere":
  22.                     price = 12.90;
  23.                     break;
  24.                 case "Normal":
  25.                     price = 7.50;
  26.                     break;
  27.                 case "Discount":
  28.                     price = 5.00;
  29.                     break;
  30.             }
  31.  
  32.             double result = (r * c) * price;
  33.  
  34.             Console.WriteLine("{0:f2}", result + " leva");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement