17.3k views
2 votes
Write a program to read customer number, Name, loan amount, interest rate and time of repayment. Calculate and display the EMI .To calculate EMI, calculate interest amount using formula: Interest amount = loan amount(1+ rate/100)time . Then add Interest amount to loan amount and divide by time (in months).

1 Answer

1 vote

Answer:

The programming language is not stated; however, I'll answer this question using Python programming language.

This program doesn't make use of comments (See Explanation Section for detailed explanation)

The program is as follows

name = input("Customer Name: ")

number = input("Customer Number: ")

loan = float(input("Loan Amount: "))

rate = float(input("Interest Rate: "))

time = int(input("Repayment Time [in months] : "))

Interest = loan * (1 + rate/100) ** time

EMI = (Interest + loan)/time

print("EMI: ", end='')

print(round(EMI,2))

Step-by-step explanation:

This line prompts for customers' name

name = input("Customer Name: ")

This line prompts for customers'number

number = input("Customer Number: ")

This line prompts for loan amount

loan = float(input("Loan Amount: "))

The line prompts for the interest rate

rate = float(input("Interest Rate: "))

This line prompts for time of loan repayment

time = int(input("Repayment Time [in months] : "))

Using the given formula, this line calculates the interest amount

Interest = loan * (1 + rate/100) ** time

The EMI is calculated using this line

EMI = (Interest + loan)/time

This line prints the string "EMI: " without the quotes

print("EMI: ", end='')

The last line of the program prints the calculated value of EMI, rounding it up to 2 decimal places

print(round(EMI,2))

User OMR
by
4.9k points