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

  What could be done to minimize such effects

What are some of the limitations or dangers you see in the use of AI technologies such as expert systems, virtual reality, and intelligent agents? What can be done to minimize such effects.

  Create a web page about a current political figure

Create a Web page about a current political figure who you admire that contains one of following: an audio file containing your thoughts about political figure.

  Description of problems and business impacts

Description of problems and business impacts

  What are the purposes of the feasibility analysis

What are the purposes of the system request and the feasibility analysis? How are they used in the project selection process?

  Describe potential challenges that the procurement process

Describe potential challenges that the procurement process may experience by not having a proper business and assurance case

  Fundamental to network management is the capability to

fundamental to network management is the ability to gather information about the status and behavior of the networked

  What is the sensitivity of the receiver just discussed

The 54-Mbps service of IEEE 802.11a uses 64-quadrature-amplitude-modulation (QAM). What is the sensitivity of the receiver just discussed?

  What would be the output of the program in display

What would be the output of the program in Display 4.2 if you omitted the ampersands (&) from the first parameter in the function declaration.

  How would you describe active directory domain services

How would you describe Active Directory Domain Services? How do you think an administrator benefits from implementing Active Directory Domain Services?

  How many books are sold each month by the publisher

Which authors are the biggest sellers of books in our stores? This is important because the publisher offers discounts for certain authors each month.

  Write a script to read three numbers

Write a script to read three numbers and find the sum of these numbers. Find the largest number. Display the largest number and the sum.

  Implement a version of the rabin-karp algorithm to search

Implement a version of the Rabin-Karp algorithm to search for patterns in two-. dimensional text. Assume both pattern and text are rectangles of characters.

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