Advertisement
IvanBorisovG

ChooseADrink2.0

Jan 30th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ChooseADrink2._0
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var profession = Console.ReadLine();
  10.             var quantity = double.Parse(Console.ReadLine());
  11.             var totalPrize = 0.0;
  12.             var drink = string.Empty;
  13.             if (profession == "Athlete")
  14.             {
  15.                 drink = "Water";
  16.                 totalPrize += 0.7;
  17.             }
  18.             else if (profession == "Businessman" || profession == "Businesswoman")
  19.             {
  20.                 drink = "Coffee";
  21.                 totalPrize +=  1.00;
  22.             }
  23.             else if (profession == "SoftUni Student")
  24.             {
  25.                 drink = "Beer";
  26.                 totalPrize += 1.7;
  27.             }
  28.             else
  29.             {
  30.                 drink = "Tea";
  31.                 totalPrize += 1.2;
  32.             }
  33.             var FinalPrize = totalPrize * quantity;
  34.             Console.WriteLine($"The {profession} has to pay {FinalPrize:f2}.");
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement