Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class SmallShop
- {
- static void Main(string[] args)
- {
- string productName = (Console.ReadLine());
- string townName = (Console.ReadLine());
- double quantity = double.Parse(Console.ReadLine());
- double productPrice = 0;
- if (productName == "coffee")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 0.5;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 0.4;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 0.45;
- }
- }
- else if (productName == "water")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 0.8;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 0.7;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 0.7;
- }
- }
- else if (productName == "beer")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 1.2;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 1.15;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 1.1;
- }
- }
- else if (productName == "water")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 0.8;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 0.7;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 0.7;
- }
- }
- else if (productName == "sweets")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 1.45;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 1.3;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 1.35;
- }
- }
- else if (productName == "peanuts")
- {
- if (townName == "Sofia")
- {
- productPrice = quantity * 1.6;
- }
- else if (townName == "Plovdiv")
- {
- productPrice = quantity * 1.5;
- }
- else if (townName == "Varna")
- {
- productPrice = quantity * 1.55;
- }
- }
- Console.WriteLine(productPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement