Kim wants to buy a car. Help Kim compute the monthly payment on a loan, given the loan amount, the annual percentage rate of interest, and the number of monthly payments. The program should allow Kim to input the loan amount, interest rate, and how many payments she wants to make. It should then compute and display the monthly payment. You will need the following variables: Payment LoanAmt InterestRate MonthlyRate NumberMonths You will need the following formulas: MonthlyRate = InterestRate/1200 Note: when the user enters InterestRate as a percentage, it must be divided by 100 to make it a decimal (i.e., 18% = 18/100 = 0.18). The InterestRate offered by car dealers is an annual rate so this must be divided by 12 to get the MonthlyRate. The formula given above combines the two steps (i.e., annual rate of 18% = 18/100 = 0.18 and the monthly rate is 0.18/12 = 0.015 or 18/(100*12) = 18/1200. Payment = LoanAmt * MonthlyRate * (1 + MonthlyRate)^NumberMonths ÷ ((1 + MonthlyRate)^NumberMonths – 1) Note: The formula must be entered carefully, exactly as shown.
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Use Raptor to answer the following questions
. Kim wants to buy a car. Help Kim compute the monthly payment on a loan,
given the loan amount, the annual percentage rate of interest, and the number of monthly payments. The
amount, interest rate, and how many payments she wants to make. It should
then compute and display the monthly payment.
You will need the following variables:
Payment LoanAmt InterestRate
MonthlyRate NumberMonths
You will need the following formulas:
MonthlyRate = InterestRate/1200
Note: when the user enters InterestRate as a percentage, it must be divided
by 100 to make it a decimal (i.e., 18% = 18/100 = 0.18). The InterestRate
offered by car dealers is an annual rate so this must be divided by 12 to get
the MonthlyRate. The formula given above combines the two steps (i.e.,
annual rate of 18% = 18/100 = 0.18 and the monthly rate is 0.18/12 =
0.015 or 18/(100*12) = 18/1200.
Payment = LoanAmt * MonthlyRate * (1 +
MonthlyRate)^NumberMonths ÷ ((1 +
MonthlyRate)^NumberMonths – 1)
Note: The formula must be entered carefully, exactly as shown.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images