IvetValcheva

01. Cinema

Jan 23rd, 2022
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Cinema
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //четем от конзолата
  10.             string ticketType = Console.ReadLine();
  11.             int row = int.Parse(Console.ReadLine());
  12.             int col = int.Parse(Console.ReadLine());
  13.  
  14.             //изчисляваме броя на местата в залатa
  15.             double income = row * col;
  16.  
  17.             //проверяваме типа на билетите и изчисляваме приходите от билетите
  18.             if(ticketType== "Premiere")
  19.             {
  20.                 income = income * 12.00;
  21.             }
  22.             else if(ticketType== "Normal")
  23.             {
  24.                 income = income * 7.50;
  25.             }
  26.             else
  27.             {
  28.                 income = income * 5.00;
  29.             }
  30.  
  31.             //извеждаме резултат
  32.             Console.WriteLine("{0:f2} leva", income);
  33.  
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment