Example: Trade Fees

A company is giving the following commissions to its traders according to the city, in which they are working and the volume of sales s:

City 0 <= s <= 500 500 < s <= 1000 1000 < s <= 10000 s > 10000
Sofia
Varna
Plovdiv
5%
4.5%
5.5%
7%
7.5%
8%
8%
10%
12%
12%
13%
14.5%

Write a program that reads the name of a city (string) and the volume of sales (decimal number) and calculates the rate of the commission fee. The result has to be shown rounded up to 2 digits after the decimal point. When there is an invalid city or volume of sales (a negative number), print "error".

Sample Input and Output

Input Output Input Output Input Output
Sofia
1500
120.00 Plovdiv
499.99
27.50 Kaspichan
-50
error

results matching ""

    No results matching ""