Advertisement
Dianov

Conditional Statements Advanced - Exercise (01. Cinema)

Nov 14th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 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.         public static void Main()
  12.         {
  13.             string typeProjection = Console.ReadLine();
  14.             int rows = int.Parse(Console.ReadLine());
  15.             int columns = int.Parse(Console.ReadLine());
  16.             double projectionPrice;
  17.             double income;
  18.  
  19.             if (typeProjection == "Premiere")
  20.             {
  21.                 projectionPrice = 12.00;
  22.                 income = rows * columns * projectionPrice;
  23.                 Console.WriteLine("{0:F2} leva", income);
  24.             }
  25.             else if (typeProjection == "Normal")
  26.             {
  27.                 projectionPrice = 7.50;
  28.                 income = rows * columns * projectionPrice;
  29.                 Console.WriteLine("{0:F2} leva", income);
  30.             }
  31.             else if (typeProjection == "Discount")
  32.             {
  33.                 projectionPrice = 5.00;
  34.                 income = rows * columns * projectionPrice;
  35.                 Console.WriteLine("{0:F2} leva", income);
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement