Solution

When reading the input, we could convert the city into small letters (with the function .ToLower()). At first we set the commission to -1. It will be changed, if the city and the price range are found in the table of commissions. To calculate the commission according to the city and volume of sales, we need a few nested if statements, as it is in the sample code below:

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/508#7.

It is a good practice to use blocks, which we enclose with curly braces { } after if and else. Also, it is recommended during writing to move aside the code after if and else with a single tabulation inward, in order to make the code more easily readable.

results matching ""

    No results matching ""