ex24.py for calculating simple interest and amount