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 _02.Small_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine();
- string town = Console.ReadLine();
- double quantity = double.Parse(Console.ReadLine());
- double cofeeSofia = 0.50;
- double cofeePlovdiv = 0.40;
- double cofeeVarna = 0.45;
- double waterSofia = 0.80;
- double waterPlovdiv = 0.70;
- double waterVarna = 0.70;
- double beerSofia = 1.20;
- double beerPlovdiv = 1.15;
- double beerVarna = 1.10;
- double sweetsSofia = 1.45;
- double sweetsPlovdiv = 1.30;
- double sweetsVarna = 1.35;
- double peanutsSofia = 1.60;
- double peanutsPlovdiv = 1.50;
- double peanutsVarna = 1.55;
- if (town == "Sofia")
- {
- if (product == "coffee")
- {
- double price = cofeeSofia * quantity;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- double price = waterSofia * quantity;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- double price = beerSofia * quantity;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- double price = sweetsSofia * quantity;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- double price = peanutsSofia * quantity;
- Console.WriteLine(price);
- }
- }
- if (town == "Plovdiv")
- {
- if (product == "coffee")
- {
- double price = cofeePlovdiv * quantity;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- double price = waterPlovdiv * quantity;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- double price = beerPlovdiv * quantity;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- double price = sweetsPlovdiv * quantity;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- double price = peanutsPlovdiv * quantity;
- Console.WriteLine(price);
- }
- }
- if (town == "Varna")
- {
- if (product == "coffee")
- {
- double price = cofeeVarna * quantity;
- Console.WriteLine(price);
- }
- else if (product == "water")
- {
- double price = waterVarna * quantity;
- Console.WriteLine(price);
- }
- else if (product == "beer")
- {
- double price = beerVarna * quantity;
- Console.WriteLine(price);
- }
- else if (product == "sweets")
- {
- double price = sweetsVarna * quantity;
- Console.WriteLine(price);
- }
- else if (product == "peanuts")
- {
- double price = peanutsVarna * quantity;
- Console.WriteLine(price);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement