VelizarAvramov

02. Choose a Drink 2.0

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