A simple interest calculation

Report a typo

Below you can find a simple program that performs simple interest calculation. The part that asks a user for the needed data has already been written for you. Now you need to write the final parts that will do all the heavy lifting:

  • calculate() should perform interest calculation and return the final interest amount and the total sum.
  • print_result() should print out the final interest amount and the total sum, as shown in the Sample Output below.

Here is the formula for calculating the interest: interest=amount×interest  rate×time100 interest = \frac {amount \times interest\;rate \times time}{100}

In the Sample Input below, the first number is the starting amount, followed by the interest rate in % and the number of years.

You do NOT need to call the functions, just complete them!

Sample Input 1:

1000
8
5

Sample Output 1:

The interest is: 400.0
The total amount is: 1400.0
Write a program in Python 3
def calculate(amount, interest_rate, time):
# your code here
return interest, total_amount

def print_result(interest, total_amount):
# your code here
___

Create a free account to access the full topic