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

  Promotional methods that constitute ambush

Find three print examples of the kind of promotional methods that constitute ambush or experiential marketing.

  Discuss the organizational opportunities and challenges

Define organizational behavior and discuss the organizational opportunities and challenges of globalization, workforce diversity, and emerging employment relati

  What factors must be assessed when critically appraising

What factors must be assessed when critically appraising quantitative studies (e.g., validity, reliability, and applicability)? Which is the most important? Why

  Performance standards of tomorrow

Comment on Dowell's statement. "The talent of tomorrow will be judged by the performance standards of tomorrow, not the standards in place today."

  Characteristics of modules is functional independence

One of the key characteristics of modules is functional independence. What does that mean?

  Draft a possible problem statement

Identify and describe one topic that may resolve a patient-care-quality problem or issue. Draft a possible problem statement.

  Practical introduction to practice reading and evaluating

Review the four perspectives of the Balanced Scorecard Module in Section 16.3 of Management: A Practical Introduction to practice

  How effective is the current organizational structure

If you were an Organizational Design consultant what recommendations would you make and why?

  What is the direct contribution to gdp coming

What is the direct contribution to GDP coming from this? government's fiscal? actions?

  Function of human resources planning

The statement which best describes the function of Human Resources Planning is (a) An integrated set of processes, programs and systems in an Organisation that focuses on maximizing employee contribution in order to achieve Qrganisational success

  Explain a stakeholder and include contingency strategies

Identify potential risks and mitigation plans. Explain a stakeholder and include mitigation and contingency strategies. Incorporate ethical implications.

  The frog and the bicycle-looking at systems

Utilising chapter 3 "The Frog and the Bicycle: Looking at Systems" (Intelligent Leadership, Alistair Mant) explain how the systems within an organisation

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