Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine().ToLower();
- string town = Console.ReadLine().ToLower();
- double quantity = double.Parse(Console.ReadLine());
- var price = 0.0;
- if (town == "sofia")
- {
- if (product == "coffee")
- {
- price = quantity * 0.50;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- price = quantity * 0.80;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- price = quantity * 1.20;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- price = quantity * 1.45;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- price = quantity * 1.60;
- Console.WriteLine(price);
- }
- else
- {
- Console.WriteLine("errore");
- }
- }
- else if (town == "plovdiv")
- {
- if (product == "coffee")
- {
- price = quantity * 0.40;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- price = quantity * 0.70;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- price = quantity * 1.15;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- price = quantity * 1.30;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- price = quantity * 1.50;
- Console.WriteLine(price);
- }
- else
- {
- Console.WriteLine("errore");
- }
- }
- else if (town == "varna")
- {
- if (product == "coffee")
- {
- price = quantity * 0.45;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- price = quantity * 0.70;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- price = quantity * 1.10;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- price = quantity * 1.35;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- price = quantity * 1.55;
- Console.WriteLine(price);
- }
- else
- {
- Console.WriteLine("errore");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment