Advertisement
bacco

Choose a Drink 2.0

May 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3. using System.Xml.Schema;
  4.  
  5. namespace tESt
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             var profession = Console.ReadLine();
  12.             var quantity = int.Parse(Console.ReadLine());
  13.  
  14.             var water = 0.70;
  15.             var coffee = 1.00;
  16.             var beer = 1.70;
  17.             var tea = 1.20;
  18.  
  19.             if (profession == "Athlete")
  20.             {
  21.                 var result = quantity * water;
  22.                 Console.WriteLine($"The {profession} has to pay {result:f2}.");
  23.             }
  24.             else if (profession == "Businessman" ||
  25.                      profession == "Businesswoman")
  26.             {
  27.                 var result = quantity * coffee;
  28.                 Console.WriteLine($"The {profession} has to pay {result:f2}.");
  29.             }
  30.             else if (profession == "SoftUni Student")
  31.             {
  32.                 var result = quantity * beer;
  33.                 Console.WriteLine($"The {profession} has to pay {result:f2}.");
  34.             }
  35.             else if (profession != "SoftUni Student" ||
  36.                      profession != "Businesswoman" ||
  37.                      profession != "Businessman" ||
  38.                      profession != "Athlete")
  39.             {
  40.                 var result = quantity * tea;
  41.                 Console.WriteLine($"The {profession} has to pay {result:f2}.");
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement