Find Jobs
Hire Freelancers

C++ Program that calculates monthly payments for a loan.

$30-250 USD

Completed
Posted almost 15 years ago

$30-250 USD

Paid on delivery
You will develop the entire program from the problem statement, including developing the pseudo code, and the test data. You must create a payment function. This function will have three formal parameters: Amount of the loan as a float, Number of months for the loan as an integer, and Monthly interest rate expressed as a decimal as a float. The function should return a floating point value that is the monthly payment on the loan using the formula below. This payment function will need to raise a floating point number to an integer power. You must use the power function given in class. You should not change anything in the power function The formula for periodic payments on a loan is: P = ___ B * i_____ (1 – (1 + i) -n ) where: P = loan payment B = balance (i.e., the amount financed) i = interest rate. Note that interest rate must be a decimal, not a percentage rate, and the rate must be for the period of the payments. Thus, if the annual interest rate (what is usually quoted by mortgage companies, banks, and credit cards) were 6%, i would be 0.005 (6/100/12) for monthly payments (12 per year) n = number of payments in the loan. For a 5 year car loan, n would be 60 ( 5 * 12); for a 30 year mortgage, n would be 360 (30 * 12). Note that (1+i) is raised to the negative n power, not to the n power After printing a welcome message, your program will ask the user if they want payments for a car loan or for a home loan. Then prompt the user for the amount of the loan, the annual interest rate (as a percentage, not a decimal number). If the user wants a car loan, calculate and print a report showing the payments for a 3 year loan (36 months), a 4 year loan (48 months), and a 5 year loan (60 payments). If the user specified a home loan, calculate payments for a 30 year loan (360 payments), and a 15 year loan (180 payments). To check your payment function, a loan of $5,700 with a 3 year length, monthly payments, and an annual interest rate of 12½ %, the result is 190.686. Creating and using a function for calculating (but not displaying) the payment is a requirement. This will not pass if your code correctly calculates the payment without using a payment function, and a power function. The payment function will need to raise a floating point number to a negative integer exponent. You need a power function that your payment function calls and uses, and it should handle negative exponents. You need to use one of the power functions that are in the files [login to view URL] or powerrecursive.cpp. Choose either the iterative power, or the recursive power. Do not change anything in the power function that you use. You are responsible for creating a set of data to fully test your program, and to submit this with your assignment. Your test data should include the test data given above ($5700 over 3 years at 12.5% has a payment of $190.686). You must appropriately document your code, use appropriate indentation, and use self documenting variable names. Each module (main, payment, and power) must have a set of header comments that lists the name of the person who created the code (i.e., you), the date the code was created, a section listing revisions and revision dates (which will be empty in this the initial release of your program), a description of what the module does, what the module needs as inputs, the type of the inputs, and where they come from either the key board, or passed as parameters. Finally the header comments should describe the outputs from the module. Any known invalid cases or problems should also be described. /************************************************************ * * * power function * * * * raises parameter number (a float) to * * to an integer power (exponent is the parameter * * with the power. The return value of power is a * * float value containing number raised to the * * exponent power float power (int exponent, float number) { float result; int i; result = 1.0; for (i=0; i< abs (exponent); i++) result *= number; if (exponent > 0) return (result); else return (1.0 / result); } * power function * * * * raises parameter number (a float) to * * to an integer power (exponent is the parameter * * with the power) usingrecursion. The return * * value of power is a float value containing * * number raised to the exponent power * float power (int exponent, float number) { float result; if (exponent == 0) return (1.0); else result = power((abs (exponent) - 1), number)* number; if (exponent >= 1) return (result); else return ( 1.0 / result); }
Project ID: 483450

About the project

10 proposals
Remote project
Active 15 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Check PMB. please. Thanks.
$50 USD in 4 days
0.0 (1 review)
1.4
1.4
10 freelancers are bidding on average $80 USD for this job
User Avatar
Hi, I can deliver this program to you in 5 days at the cost of $75.
$75 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I am 3 years experienced in C/C++ programming.
$100 USD in 4 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi Read your requirements and i believe i can deliver this program to you in 6 days at the price mentioned in the bid. Please feel free to contact me with any other queries.
$175 USD in 6 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I would deliver you the project in one day that's a guarantee.. Thnks lets start working...
$50 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi I can do this project with in minimun cost. Contact with full trust.....
$100 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
i will start doing on this project if we provide more information.
$50 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
The program will have check boxes to select the type of loan,drop down boxes to select the loan amount, interest rate and the repayment period. I propose to test the program for various conditions including possible mis-typing of input data
$100 USD in 10 days
0.0 (0 reviews)
0.0
0.0
User Avatar
It can be done in 7 days with quality. It will be properly tested and documented with all requirements specifications.
$45 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Please check PMB. Kind regards, Yunhee.
$50 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
largo, United States
0.5
1
Member since Aug 6, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.