Question
Car Loan Write a program to analyze a car loan. See Fig.3.79 . The user should enter the amount of the loan, the annual percentage
Car LoanWrite a program to analyze a car loan. SeeFig.3.79. The user should enter the amount of the loan, the annual percentage rate of interest, and the duration of the loan in months. After each piece of data is entered, the data should be checked to make sure it is reasonable. If bad data has been supplied, the user should be so advised. Otherwise, the monthly payment and the total amount of interest paid should be displayed. The formula for the monthly payment is
monthlypayment= pr / 1(1+r)-n,
wherepis the amount of the loan,ris the monthly interest rate (annual rate divided by12) given as a number between 0 (for 0%) and 100 (for 100%), andnis the duration of the loan in months. The formula for the total interest paid is
totalinterest = n[monthlypayment]p
.
Enter the amount of the loan: 18000 Enter the interest rate: 5.25 Enter the duration in months: 60 Monthly payment: $341.75 Total interest paid: $2,505.00
FIGURE
3.79Possible outcome of
Programming Project
1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started