Example: Small Shop

A Bulgarian entrepreneur opens small shops in a few cities with different prices for the following products:

product / city Sofia Plovdiv Varna
coffee
water
beer
sweets
peanuts
0.50
0.80
1.20
1.45
1.60
0.40
0.70
1.15
1.30
1.50
0.45
0.70
1.10
1.35
1.55

Calculate the price by the given city (string), product (string) and quantity (decimal number).

Sample Input and Output

Input Output Input Output
coffee
Varna
2
0.9 peanuts
Plovdiv
1
1.5
Input Output Input Output
beer
Sofia
6
7.2 water
Plovdiv
3
2.1

Video: Small Shop

Watch this video to learn how to solve this problem: https://youtu.be/kU_ru7GK-Mg.

Solution

We convert all of the letters into lower register using the function .ToLower(), in order to compare products and cities no matter what the letters are – small or capital ones.

Testing in the Judge System

Test your solution here: https://judge.softuni.org/Contests/Practice/Index/508#1.

results matching ""

    No results matching ""