Compute future bank balances

Assignment Help Computer Engineering
Reference no: EM132210355

Question :

Write a program that an investor can use to compute future bank balances. The program asks the user for two pieces of information:

The amount of an initial deposit (entered as a double number in dollars, such as 42.31 for 42 dollars and 31 cents), and an interest rate (entered as a double number, such at 0.05 for 5% interest).

The program prints the results of three computations, each of which assumes that interest is paid once per year on the amount in the account at the year's start:

The balance in the account after one year of interest;

The balance in the account after ten years of compounding interest;

The number of years required for the balance to reach at least one million dollars.

The account balances should be printed with a dollar sign in front and rounded to two decimal places (such as $42.31).

In order to get numbers to print with two decimals, include both and and place these lines in your main function (just after you declare any local variables that the main function uses): cout.precision(DIGITS); cout.setf(ios::fixed, ios::floatfield);

Your program must include functions with these exact prototypes: double newBalance(double initialBalance, double interestRate);

// This first version of the new balance function computes the

// final account balance that will be reached by starting with

// an initial balance and adding one year's interest at a given

// interest rate (such as 0.05 for 5%).The function works

// correctly for any non-negative arguments.

double newBalance(double initialBalance, double interestRate, int n);

// This second version of the new balance function computes the

// final account balance that will be reached by starting with

// an initial balance and adding some n number of years of interest

// at a given interest rate (such as 0.05 for 5%). The interest is added /

// once per year and it is applied to the entire balance.

// For example, new_balance(100.00, 0.10, 2) is 121.00 since

// the first year received 10.00 interest (10% of 100) and the /

// second year received 11.00 interest (10% of the 110, which

// was the second year's starting balance). The function works // correctly for any non-negative arguments.

// Notice n is not an appropriate variable name, but will not be // deducted for this program.

int yearsNeeded(double initialBalance, double interestRate, double goal); // The years needed function computes the number of years needed for // a given starting balance to reach a given goal at a certain rate // of compound interest. The function works correctly for any // positive arguments.

Important Note:

Your program must include the three functions show above in this exact format. Validate all input. Do not use using namespace std;.

We will actually test your program by throwing away your main program and using our own main program that calls the functions with lots of different numbers.

Reference no: EM132210355

Questions Cloud

Designing the automated internal controls : Who should the IT workers collaborate with when evaluating or designing the automated internal controls of a computer-based information system?
Explain the interlinking model of quality and profitability : Explain the interlinking model of quality and profitability (Exhibit 4.2). How does it connect to business and operations strategy?
Write a program that will input two arrays of information : Write a program that will input two arrays of information. Each array will contain exactly 4 floating point values.
Explain which method of communication you prefer : Compare the following communication tools that could be used to create a response, and explain which method of communication you prefer
Compute future bank balances : Write a program that an investor can use to compute future bank balances. The program asks the user for two pieces of information:
Construct the new project network : MTH601 - Operation Research - Construct the new project network - find the approximate probability that the project will be completed within 22 months
Designing organizations for the international environment : Analyze the material in the article using concepts and frameworks.Designing Organizations for the International Environment
Ask the user to input a set of row and column values : Write a program to implement the simulation of life as described in Scientific American by Martin Gardner
How coordinated care gives patients freedom to stay home : The PBS News Hour “How coordinated care gives patients the freedom to stay home” looks at keeping patients healthy and at home.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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