Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementsAdvancedExercise/01.Cinema

Jan 24th, 2021
104
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 ConsoleApp17
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string projection = Console.ReadLine();
  10.             int rNum = int.Parse(Console.ReadLine());
  11.             int cNum = int.Parse(Console.ReadLine());
  12.  
  13.             double premierPrice = 12.00;
  14.             double normalPrice = 7.50;
  15.             double discountPrice = 5.00;
  16.  
  17.             double income = 0;
  18.  
  19.             if (projection == "Premiere")
  20.             {
  21.                 income = (rNum * cNum) * premierPrice;
  22.                 Console.WriteLine($"{income:f2} leva");
  23.             }
  24.  
  25.             else if (projection == "Normal")
  26.             {
  27.                 income = (rNum * cNum) * normalPrice;
  28.                 Console.WriteLine($"{income:f2} leva");
  29.             }
  30.  
  31.             else if (projection == "Discount")
  32.             {
  33.                 income = (rNum * cNum) * discountPrice;
  34.                 Console.WriteLine($"{income:f2} leva");
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement