Write a Python program to calculate the amount payable if money has been lent on simple interest. Principal or money lent = P, Rate of interest = R% per annum and Time = T years. Then Simple Interest (SI) = (P x R x T)/100. Amount payable = Principal + SI. P, R and T are given as input to the program.
Program to Calculate Amount Payable on Simple Interest
python
Program to calculate amount payable on simple interest
Input: Principal, Rate of interest, Time
P = float(input("Enter Principal amount: ")) R = float(input("Enter Rate of interest (% per annum): ")) T = float(input("Enter Time (in years): "))
Calculate Simple Interest
SI = (P * R * T) / 100
Calculate Amount payable
Amount = P + SI
Display the result
print("Simple Interest =", SI) print("Amount Payable =", Amount)
Explanation:
The program first accepts Principal (P), Rate of interest (R), and Time (T) as input from the user. The input values are converted to float type to handle decimal values.
The Simple Interest (SI) is calculated using the formula: SI = (P × R × T)/100. This formula multiplies the principal, rate, and time together, then divides by 100 to get the interest amount.
The Amount payable is then computed by adding the Principal and Simple Interest: Amount = P + SI. This gives the total amount to be repaid after the given time period.
Finally, both the Simple Interest and Amount Payable are displayed as output.
Explanation
This question tests the student's understanding of arithmetic operations and formula implementation in Python. The program demonstrates: (1) taking user input using input() function, (2) explicit type conversion using float() as shown in Program 5-8 of the context, (3) applying mathematical formulas, and (4) displaying results using print(). The formula SI = (P × R × T)/100 and Amount = Principal + SI are directly taken from the question context.
Solution Steps
Step 1: Accept P, R, and T as input from user using input() function
Step 2: Convert input values to float type for decimal handling
Step 3: Calculate Simple Interest using formula SI = (P × R × T)/100
Step 4: Calculate Amount Payable using formula Amount = P + SI
Step 5: Display Simple Interest and Amount Payable using print()