BubaLazi

03.ChooseAdrink

May 30th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 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 HomeworksConditionalStatments
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var profession = Console.ReadLine();
  14.             var quantity = int.Parse(Console.ReadLine());
  15.            
  16.             var totalPrice = 0.00;
  17.  
  18.  
  19.             if (profession == "Athlete")
  20.             {
  21.                
  22.                 totalPrice = 0.70 * quantity;
  23.                 //Console.WriteLine("The {0} has to pay {1:F2}", profession, totalPrice);
  24.             }
  25.             else if ((profession == "Businessman") || (profession == "Businesswoman"))
  26.             {
  27.                
  28.                 totalPrice = 1.00 * quantity;
  29.                 //Console.WriteLine("The {0} has to pay {1:F2}", profession, totalPrice);
  30.             }
  31.             else if (profession == "SoftUni Student")
  32.             {
  33.                
  34.                 totalPrice = 1.70 * quantity;
  35.                 //Console.WriteLine("The {0} has to pay {1:F2}", profession, totalPrice);
  36.             }
  37.             else
  38.             {
  39.              
  40.                 totalPrice = 1.20 * quantity;
  41.                 //Console.WriteLine("The {0} has to pay {1:F2}", profession, totalPrice);
  42.             }
  43.  
  44.             Console.WriteLine("The {0} has to pay {1:F2}.", profession, totalPrice);
  45.  
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment