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