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 smalShopTwo
- {
- class smallShopTwo
- {
- static void Main(string[] args)
- {
- var product = Console.ReadLine();
- var town = Console.ReadLine();
- var quantity = double.Parse(Console.ReadLine());
- if (town == "Sofia")
- {
- if (product == "coffee")
- {
- Console.WriteLine(quantity * 0.50);
- }
- else if (product == "water")
- {
- Console.WriteLine(quantity * 0.80);
- }
- else if (product == "beer")
- {
- Console.WriteLine(quantity * 1.20);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(quantity * 1.45);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(quantity * 1.60);
- }
- else
- {
- Console.WriteLine("Invalid product");
- }
- }
- else if (town == "Plovdiv")
- {
- if (product == "coffee")
- {
- Console.WriteLine(quantity * 0.40);
- }
- else if (product == "water")
- {
- Console.WriteLine(quantity * 0.70);
- }
- else if (product == "beer")
- {
- Console.WriteLine(quantity * 1.15);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(quantity * 1.30);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(quantity * 1.50);
- }
- else
- {
- Console.WriteLine("Invalid product");
- }
- }
- else if (town == "Varna")
- {
- if (product == "coffee")
- {
- Console.WriteLine(quantity * 0.45);
- }
- else if (product == "water")
- {
- Console.WriteLine(quantity * 0.70);
- }
- else if (product == "beer")
- {
- Console.WriteLine(quantity * 1.10);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(quantity * 1.35);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(quantity * 1.55);
- }
- else
- {
- Console.WriteLine("Invalid product");
- }
- }
- else
- {
- Console.WriteLine("Invalid town");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment