Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _11._12._2019
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Enter a profession and you will get the best possible drink: ");
- string prof = Console.ReadLine();
- Console.WriteLine("Enter the amount of drinks you want to buy: ");
- int quantity = int.Parse(Console.ReadLine());
- double price;
- switch (prof)
- {
- case "Athlete":
- price = 0.7;
- break;
- case "Businessman":
- case "Businesswoman":
- price = 1;
- break;
- case "SoftUni student":
- price = 1.7;
- break;
- default:
- price = 2.1;
- break;
- }
- Console.WriteLine($"The {prof} has to pay {price*quantity:F2}$");
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment