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 Times_15
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine().ToLower();
- string town = Console.ReadLine().ToLower();
- double product_quantity = double.Parse(Console.ReadLine());
- Dictionary<string, double>
- sofia = new Dictionary<string, double>()
- {
- {"coffee", 0.50},
- {"water", 0.80},
- {"beer", 1.20},
- {"sweets", 1.45},
- {"peanuts", 1.60}
- },
- varna = new Dictionary<string, double>()
- {
- {"coffee", 0.45},
- {"water", 0.70},
- {"beer", 1.10},
- {"sweets", 1.35},
- {"peanuts", 1.55}
- },
- plovdiv = new Dictionary<string, double>()
- {
- {"coffee", 0.40},
- {"water", 0.70},
- {"beer", 1.15},
- {"sweets", 1.30},
- {"peanuts", 1.50}
- };
- if (town == "sofia")
- {
- double calc_price = (product_quantity * sofia[product]);
- Console.WriteLine(calc_price);
- }
- else if (town == "varna")
- {
- double calc_price = (product_quantity * varna[product]);
- Console.WriteLine(calc_price);
- }
- else if (town == "plovdiv")
- {
- double calc_price = (product_quantity * plovdiv[product]);
- Console.WriteLine(calc_price);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement