Commissions¶
The head of a bank office sells two different types of products: bank deposits and preferred stocks. For each product, if the head sells 500.000€ or more, he gains a commission on the total sold: a 0.05% for bank deposits and a 3% for preferred stocks. If the head sells less than 500.000€, his commission is 0€.
Write the function commissions() that takes the amount of
bank deposits and the amount of preferred stock (real values) sold by
the bank head, and returns the commission (real) which corresponds to
the bank head.
Save the function into a file commissions.py. The function
must pass the following doctest:
>>> round(commissions (50000.0, 80000.0), 2)
0.0
>>> round(commissions (50000.0, 825350.0), 2)
24760.5
>>> round(commissions (515263.0, 80000.0), 2)
257.63
>>> round(commissions (753850.0, 500000.0), 2)
15376.92
>>> round(commissions (500000, 753850.0), 2)
22865.5
Note
More tests are provided in the commissions.txt file.
Solutions
A solution of these functions is provided in the
commissions.py file.