Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Orders
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine();
- int volume = int.Parse(Console.ReadLine());
- double sum = 0;
- if (product == "coffee")
- {
- sum = 1.5;
- Coffee(volume, sum);
- }
- else if (product == "water")
- {
- sum = 1;
- Water(volume, sum);
- }
- else if (product == "coke")
- {
- sum = 1.4;
- Coke(volume, sum);
- }
- else if (product == "snacks")
- {
- sum = 2;
- Snacks(volume, sum);
- }
- }
- static void Snacks(int volume, double sum)
- {
- sum *= volume;
- Console.WriteLine($"{sum:F2}");
- }
- static void Coke(int volume, double sum)
- {
- sum *= volume;
- Console.WriteLine($"{sum:F2}");
- }
- static void Water(int volume, double sum)
- {
- sum *= volume;
- Console.WriteLine($"{sum:F2}");
- }
- static void Coffee(int volume, double sum)
- {
- sum *= volume;
- Console.WriteLine($"{sum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement