veronikaaa86

02. Choose A Drink vol. 2

Jan 31st, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Ex2_ChooseADtinkTwo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string profession = Console.ReadLine();
  14.             int quantity = int.Parse(Console.ReadLine());
  15.  
  16.             double sum = 0;
  17.             switch (profession)
  18.             {
  19.                 case "Athlete":
  20.                     sum = quantity * 0.70;
  21.                     Console.WriteLine("The {0} has to pay {1:F2}.",profession, sum);
  22.                     break;
  23.                 case "Businessman":
  24.                 case "Businesswoman":
  25.                     sum = quantity * 1.00;
  26.                     Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
  27.                     break;
  28.                 case "SoftUni Student":
  29.                     sum = quantity * 1.70;
  30.                     Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
  31.                     break;
  32.                 default:
  33.                     sum = quantity * 1.20;
  34.                     Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
  35.                     break;
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment