Advertisement
martinvalchev

Choose_a_Drink_2._0

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