Write a loan calculator program

Assignment Help C/C++ Programming
Reference no: EM13168377

Write a loan calculator program in C++ that displays monthly balances for user-specified loan terms. To be flexible, you decide to specify the loan terms in a file and provide that filename  entered from the keyboard. To keep things simple, the loan terms (input) file will have the following syntax:
<loan amount><tab character><number of monthly payments><tab character><annual interest rate>
save the output in a file that is also specified  entered from the keyboard.

The formula for calculating a monthly payment is:
P = the initial amount of the loan
I = the annual interest rate
J = monthly interest rate = (I / 100) / 12
N = number of months
M = monthly payment

                   J
M  = P * (J + -------------)
                      N
              ( 1 + J)  - 1   
or

M = P * (J + (J / ((1+J)^N - 1)))

use this data

P = $2,800,000
I = 8.40% (that's the interest rate that I got for my Zonda :)
J = (8.4 / 100) / 12 = 0.007
N = 24 (2 years)

M = $2,800,000 * (0.007 + (0.007 / ((1+0.007)^24 - 1))) = $127,148.37

PLS PLEASE NOTE only the first and last three months be detailed by your program (and no more) and that they be separated with an ellipsis ("...").

THe output should look like this

Initial balance: $2800000.00
Number of payments: 24
Annual interest rate: 8.40%
Monthly payment: $127147.84

Month   Interest        Principal       Balance
1       $19600.00       $107547.84      $2692452.25
2       $18847.17       $108300.68      $2584151.50
3       $18089.06       $109058.78      $2475092.75
...
22      $2633.15        $124514.69      $251650.28
23      $1761.55        $125386.29      $126263.99
24      $883.85 $126263.99      $0.00

Total interest paid: $251548.19

Reference no: EM13168377

Questions Cloud

Computers have trended to larger word : Since the beginning, computers have trended to larger word sizes, 8 to 16 to 32 and now some 64 bit computers. Explain a pro or a con in a computer with a larger word size, or comment on someone else's pro or con.
Choose the answer that shows a correctly balanced equation : Choose the answer that shows a correctly balanced equation.
If m is a dfa accepting language b : If M is a DFA accepting language B, then exchangeing the accept and reject states gives a new DFA accepting the complement of B. Does this work for an NFA, why?
Calculate the amount of energy required in calories : calculate the amount of energy required in calories to heat 145g of h2o from 22.3 degrees c to 75.0 degrees c.
Write a loan calculator program : Write a loan calculator program in C++ that displays monthly balances for user-specified loan terms. To be flexible, you decide to specify the loan terms in a file and provide that filename  entered from the keyboard. To keep things simple
Calculate the enthalpy change for the dissolution of nh4no3 : Assuming the solution has a heat capacity of 4.18 J/°C·g and assuming no heat loss to the calorimeter, calculate the enthalpy change for the dissolution of NH4NO3 in units of kJ/mol.
Two hosts, a and b, are separated by 20,000 : two hosts, A and B, are separated by 20,000 kilometers and are connected by a link of R=2 Mbps, and there are 4 routers between A and B. Suppose the propagation speed over the link is 2.5*108 meters/sec, average queueing time is 2ms,
What are the rates of production of p4 and h2 : If the reaction is carried out in a 2.0 L container and 0.010 mol of PH3 is consumed each second, what are the rates of production of P4 and H2?
Write a program that draws a picture of a house : Write a program that draws a picture of a house. It could be as simple as the accompanying figure, or if you like, make it more elaborate

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program to find the factors

Write a c++ program to find the factors of an integer (entered by the user) which are themselves squares.

  The access attributes, list and describe

Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is?

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write code that declares an int array named month

Write code that declares an int array named month with 5 rows and 7 coloumns and initializes every element to -1.

  Gcd between two positive integer numbers

Write a C++ code for calculating the GCD (Greatest Common Divisor) between two positive integer numbers. You  should  use Euclid's  original  subtraction  based  GCD algorithm ( not  using  modulo operator). You should write a function following t..

  Include the iostream, fstream, string, and cctype libraries

1. Include the iostream, fstream, string, and cctype libraries in your program.

  Model-view-controller

Explain Model-View-Controller paradigm

  Program to compute gross wages for employee using array

Write program which uses the following arrays: payRate: array of seven floats to hold each employee's hourly pay rate. wages: array of seven floats to hold each employee's gross wages.

  Two-dimensional array of double to hold the sales

Suppose you have a two-dimensional array of double to hold the sales amounts for all your salespeople three years. Assume you employ 50 salespeople and this array already holds valid data.

  The "continue" and "break" statements

How are the "continue" and "break" statements different from the "exit" and "return" statements?

  Prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places

  Each clone will communicate to the parent process

Write a program that will create 3 clones. Each clone will communicate to the parent process over a pipe (There are 3 pipes) Each process will write Process n.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd