Invest that computes and return the total interest

Assignment Help Business Management
Reference no: EM132294011

Using Java, compile a method named invest that computes and return the total interest earned on a financial investment. Once per year, the bank pays interest to the investor at a given fixed rate. As the investment earns interest, that interest is added to the investment and therefore the interest begins earning interest of its own ("compounding").

Your method should accept three parameters in the main function: the initial amount of the investment in dollars (as a real number such as 1500.0 for $1,500.00), the yearly interest rate (as a real number such as 3.5 for 3.5% interest) and the number of years for which to invest (as an integer such as 6 for 6 years) and then returns the total interest earned (as a real number such as 35.60 for $35.60).

Your method should print the value of the investment after each year. Upon return, your program should print cumulative interest earned over all years in the main function. For example, an investment of $100.00 at 10% interest for 5 years would lead to this call:

// $100.00 at 10% interest for 5 years

double totalInterest = invest(100.00, 10.0, 5);

The call would produce the following console output. Dollar amounts print with 2 digits after the decimal.

Notice that we are not simply adding 10% of $100.00 (or $10.00) each year; that would lead to $50 of total interest earned. The first year adds 10% of $100.00, but the second year adds 10% of $110.00, or $11.00, leading to a total of $121.00. The third year adds 10% of $121.00, or $12.10, leading to a total of $133.10 and so on. The interest is cumulative. You may assume that all parameter values passed are non-negative.

Reference no: EM132294011

Questions Cloud

Source coding implementation using matlab : Source Coding Implementation Using MATLAB/Simulink - Apply and evaluate the principles used in the generation, transmission and reception of digitally modulated
The concept of strategic planning environmental scanning : The concept of Strategic Planning environmental scanning is, by far, one of the most critical factors.
What are the various types of cyber threats : What are the various types of cyber threats and which are the most successful.
What is a spreadsheet : What is a spreadsheet. How do we use spreadsheets as data storage and data analysis tools? How do you use spreadsheets to manage daily administrative tasks.
Invest that computes and return the total interest : Using Java, compile a method named invest that computes and return the total interest earned on a financial investment.
How do you see the agencies can work better together : How do the agencies work together or contrast each other, how do you see the agencies can work better together in relation to HSEM subjects.
Discuss the topic of cyber security controls : A cyber attach could occur in Customs and Boarder Patrol, FEMA, Immigration, or any of the other elements that make up the department.
Describe why this policy is important to the united states : What are the major issues facing each country involved? What are the reasons for initiating changes to the policy?
Is the death penalty a legitimate form of social justice : Texas utilizes the "Death Penalty" more than any other state in the United States. Is the Death Penalty a legitimate form of Social Justice, Why or why not?

Reviews

Write a Review

Business Management Questions & Answers

  Explaining servant leadership viewed in islamic view

How is servant leadership viewed in Islamic view? What is an effective way to measure Islamic leadership in the workplace?

  What factors can influence vendor selection why is it so

what factors can influence vendor selection? why is it so important to understand the purchasing and buying process

  Finding the best buy

Corporate governance has become a hot issue in the U.S. over the past two decades. From your analysis of the case study, determine two possible corporate governance challenges that might be faced by Best Buy as a result of its rapid growth and wh..

  Difference between general and specific environment

How would you characterize business environment? Explain, with examples, the difference between general and specific environment.

  Us government securities with one-year maturity

The interest rate on South Korean government securities with one-year maturity is 4 percent and the expected inflation rate for the coming year is 2 percent.

  Marketplace live simulation

This part of your Marketplace Live simulation assignment is individual. You will present the content to your team members and determine an appropriate digital marketing plan to include in your Marketing Plan assignment.

  Explain what is an incident report in health care

Explain What is an incident report in health care and When would you complete an incident report and what would you be sure to include in the report?

  Template for future motivational deliveries to staff

Should there be some recording of successes in these scenarios to use as a template for future motivational deliveries to staff?

  Transportation and warehousing of pharmaceuticals in canada

Identify and explain three safety and/or regulatory requirements that must be adhered to for the transportation and warehousing of pharmaceuticals

  Ceases to withdraw funds from the account

He also wants to have $25,000 left to give you when he ceases to withdraw funds from the account. For how many years can he make the $35,000 withdrawals and still have $25,000 left in the end?

  Discuss the components and the history of the new realities

Discuss the components and the history of these new realities in our world and how our lives have been affected by these new realities.

  Technology impact on healthcare decision making

Technological advances have changed the way medical care is practiced and delivered. Identify and describe three of the most significant clinical

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