Advertisement
koksibg

Choose_a_Drink_2.vers.2

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