Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ChooseADrink
- {
- class Program
- {
- static void Main()
- {
- var input = Console.ReadLine();
- var quantity = int.Parse(Console.ReadLine());
- var prices = new Dictionary<string, double>() { { "Water", 0.7 }, { "Coffee", 1.0 }, { "Beer", 1.7 }, { "Tea", 1.2 } };
- double totapPrice = 0.0;
- switch (input)
- {
- case "Athlete":
- totapPrice = quantity * prices["Water"];
- break;
- case "SoftUni Student":
- totapPrice = quantity * prices["Beer"];
- break;
- case "Businessman":
- case "Businesswoman":
- totapPrice = quantity * prices["Coffee"];
- break;
- default:
- totapPrice = quantity * prices["Tea"];
- break;
- }
- Console.WriteLine($"The {input} has to pay {totapPrice:F2}.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement