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 Small_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine();
- string city = Console.ReadLine();
- double quantity = double.Parse(Console.ReadLine());
- double coffeesofia = 0.50d;
- double beersofia = 1.20d;
- double sweetsofia = 1.45;
- double watersofia = 0.80d;
- double peanutssofia = 1.60;
- double coffeeplovdiv = 0.40d;
- double beerplovdiv = 1.15d;
- double sweetplovdiv = 1.30;
- double waterplovdim = 0.70d;
- double peanutsplovdim = 1.50;
- double coffeevarna = 0.45d;
- double beervarna = 1.10d;
- double sweetvarna = 1.35;
- double watervarna = 0.70d;
- double peanutsvarna = 1.55;
- //coffee
- if(product=="coffee")
- {
- if(city=="Sofia")
- {
- double price = quantity * coffeesofia;
- Console.WriteLine(price);
- }
- else if(city=="Plovdiv")
- {
- double price = quantity * coffeeplovdiv;
- Console.WriteLine(price);
- }
- else if(city=="Varna")
- {
- double price = quantity * coffeevarna;
- Console.WriteLine(price);
- }
- }
- //water
- if(product=="water")
- {
- if(city=="Sofia")
- {
- double price = quantity * watersofia;
- Console.WriteLine(price);
- }
- else if (city == "Plovdiv")
- {
- double price = quantity * waterplovdim;
- Console.WriteLine(price);
- }
- else if (city == "Varna")
- {
- double price = quantity * watervarna;
- Console.WriteLine(price);
- }
- }
- //beer
- if (product == "beer")
- {
- if (city == "Sofia")
- {
- double price = quantity * beersofia;
- Console.WriteLine(price);
- }
- else if (city == "Plovdiv")
- {
- double price = quantity * beerplovdiv;
- Console.WriteLine(price);
- }
- else if (city == "Varna")
- {
- double price = quantity * beervarna;
- Console.WriteLine(price);
- }
- }
- //sweets
- if (product == "sweets")
- {
- if (city == "Sofia")
- {
- double price = quantity * sweetsofia;
- Console.WriteLine(price);
- }
- else if (city == "Plovdiv")
- {
- double price = quantity * sweetplovdiv;
- Console.WriteLine(price);
- }
- else if (city == "Varna")
- {
- double price = quantity * sweetvarna;
- Console.WriteLine(price);
- }
- }
- //peanuts
- if (product == "peanuts")
- {
- if (city == "Sofia")
- {
- double price = quantity * peanutssofia;
- Console.WriteLine(price);
- }
- else if (city == "Plovdiv")
- {
- double price = quantity * peanutsplovdim;
- Console.WriteLine(price);
- }
- else if (city == "Varna")
- {
- double price = quantity * peanutsvarna;
- Console.WriteLine(price);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment