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 SmallShop
- {
- class SmallShop
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine();
- string town = Console.ReadLine();
- double quantity = 0;
- double price = 0;
- if (town.Equals("Sofia"))
- {
- if (product.Equals("coffee"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.50;
- double priceOfCaffe = quantity * price;
- Console.WriteLine(priceOfCaffe);
- }
- else if (product.Equals("water"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.80;
- double priceOfWater = quantity * price;
- Console.WriteLine(priceOfWater);
- }
- else if (product.Equals("beer"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.20;
- double priceOfBeer = quantity * price;
- Console.WriteLine(priceOfBeer);
- }
- else if (product.Equals("sweets"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.45;
- double priceOfSweets = quantity * price;
- Console.WriteLine(priceOfSweets);
- }
- else
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.60;
- double priceOfPeanuts = quantity * price;
- Console.WriteLine(priceOfPeanuts);
- }
- }
- if(town.Equals("Plovdiv"))
- {
- if(product.Equals("coffee"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.40;
- double priceOfcoffee = quantity * price;
- Console.WriteLine(priceOfcoffee);
- }
- else if(product.Equals("water"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.70;
- double priceOfWater = quantity * price;
- Console.WriteLine(priceOfWater);
- }
- else if(product.Equals("beer"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.15;
- double priceOfbeer = quantity * price;
- Console.WriteLine(priceOfbeer);
- }
- else if(product.Equals("sweets"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.30;
- double priceOfSweets = quantity * price;
- Console.WriteLine(priceOfSweets);
- }
- else
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.50;
- double priceOfPeanuts = quantity * price;
- Console.WriteLine(priceOfPeanuts);
- }
- }
- if(town.Equals("Varna"))
- {
- if(product.Equals("coffee"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.45;
- double priceOfCoffee = quantity * price;
- Console.WriteLine(priceOfCoffee);
- }
- else if(product.Equals("water"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 0.70;
- double priceOfWater = quantity * price;
- Console.WriteLine(priceOfWater);
- }
- else if(product.Equals("beer"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.10;
- double priceOfBeer = quantity * price;
- Console.WriteLine(priceOfBeer);
- }
- else if(product.Equals("sweets"))
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.35;
- double priceOfSweets = quantity * price;
- Console.WriteLine(priceOfSweets);
- }
- else
- {
- quantity = double.Parse(Console.ReadLine());
- price += 1.55;
- double priceOfPeanuts = quantity * price;
- Console.WriteLine(priceOfPeanuts);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment