Advertisement
koksibg

Choose_a_Drink_2

May 25th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 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 (profession == "Athlete") price = 0.70;
  13.             else if (profession == "Businessman" || profession == "Businesswoman") price = 1.0;
  14.             else if (profession == "SoftUni Student") price = 1.70;
  15.             else price = 1.20;
  16.             Console.WriteLine($"The {profession} has to pay {price * quantity:f2}.");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement