Advertisement
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 ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("enter city:");
- string city = Console.ReadLine().ToLower();
- Console.WriteLine("enter product:");
- string product = Console.ReadLine().ToLower();
- Console.WriteLine("enter quantity:");
- var quantity = double.Parse(Console.ReadLine());
- if (city == "sofia")
- {
- if (product == "coffee")
- Console.WriteLine(0.50 * quantity);
- else if (product == "water") Console.WriteLine(0.80 * quantity);
- else if (product == "beer") Console.WriteLine(1.20 * quantity);
- else if (product == "sweets") Console.WriteLine(1.45 * quantity);
- else if (product == "peanuts") Console.WriteLine(1.60 * quantity);
- else
- Console.WriteLine("sold out");
- }
- if (city == "plovdiv")
- {
- if (product == "coffee") Console.WriteLine(0.40 * quantity);
- else if (product == "water") Console.WriteLine(0.70 * quantity);
- else if (product == "beer") Console.WriteLine(1.15 * quantity);
- else if (product == "sweets") Console.WriteLine(1.30 * quantity);
- else if (product == "peanuts") Console.WriteLine(1.50 * quantity);
- else
- Console.WriteLine(" this product has been sold out");
- }
- if (city== "varna")
- {
- if (product == "coffee")
- Console.WriteLine(0.45 * quantity);
- else if (product == "water")
- Console.WriteLine(0.70 * quantity);
- else if (product == "beer")
- Console.WriteLine(1.10 * quantity);
- else if (product == "sweets")
- Console.WriteLine(1.35 * quantity);
- else if (product == "peanuts")
- Console.WriteLine(1.55 * quantity);
- else
- Console.WriteLine(" this product has been sold out");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement