We borrowed $1000 at a 10% annual interest rate. If we did not make a payment for two years, and assuming there is no penalty for non-payment, how much do we owe now? Assign the result to a variable called debt.
代码:
principal = 1000;
rate_of_interest = 10;
n = 2;
time_period = n-1;
simple_interest = (principal * rate_of_interest * time_period)/100
amount = principal + simple_interest
principal = amount;
simple_interest = (principal * rate_of_interest * time_period)/100
debt = principal + simple_interest