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