daily pastebin goal
41%
SHARE
TWEET

Choose A Drink 2.0

a guest Jan 29th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ChooseDrink2
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             string profession=Console.ReadLine();
  10.             int quantity = int.Parse(Console.ReadLine());
  11.            
  12.             decimal price=0.00m;
  13.            
  14.             switch (profession)
  15.             {
  16.                 case "Athlete":
  17.                     price=quantity*0.70m;
  18.                     Console.WriteLine("The {0} has to pay {1}.",profession, price);
  19.                     break;
  20.                 case "Businessman":
  21.                     price=quantity*1.00m;
  22.                     Console.WriteLine("The {0} has to pay {1}.", profession, price);
  23.                     break;
  24.                 case "Businesswoman":
  25.                     price=quantity*1.00m;
  26.                     Console.WriteLine("The {0} has to pay {1}.", profession, price);
  27.                     break;
  28.                 case "Softuni Student":
  29.                     price=quantity*1.70m;
  30.                     Console.WriteLine("The {0} has to pay {1}.", profession, price);
  31.                     break;
  32.                 default:
  33.                     price=quantity*1.20m;
  34.                     Console.WriteLine("The {0} has to pay {1}.", profession, price);
  35.                     break;
  36.             }
  37.            
  38.             Console.Write("Press any key to continue . . . ");
  39.             Console.ReadKey(true);
  40.         }
  41.     }
  42. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top