HW 8 Call Methods in Other Class This HW doesn\'t have a Part A-answering questi
ID: 3710936 • Letter: H
Question
HW 8 Call Methods in Other Class This HW doesn't have a Part A-answering questions in document. There are only one problem that you need to write java programs to solve. You need to write two classes (two java files) that are in the same package (saved in the same location, under the same directory) 1. Exercise 6.7 (page 237) in the textbook (40 pts) Requirements: a) You need to write two classes for this problem. Name them Investment and InvestmentTest. The associated java files should be Investment.java and InvestmentTest.java. Make sure the two java files are saved at the same location on your computer b) The InvestmentTest class should contain only a main method. In this main method, the program takes user inputs of three values investmentAmount in double, annualRate (annual interest rate) in double, and years in integer. The main method should also invoke a method from the Investment class to print the future value table for 30 years c) The Investment class should contain two methods 1 futureInvestment Value ) -use three parameters (investmentAmount, monthlylnterestRate, and years) to calculate and return the future value. The formula to calculate the future value is future Value investmentAmount*Math.po monthly InterestRate, years 12) Note that monthlyInterestRate- annualR ate 12 2. printFutureValueTable 0-print the future value table for 30 years. The table should look like the one below Enter investment amount, for example 100: 10000 Enter yearly interest rate, for example 5.25: 3-75 Years Future Value 0381.51 10777.58 1188.76 11615.63 2058.78 2518.83 2996.44 3492.28 14007.02 14541.41 5096.18 15672.12 16270.03 16890.76 17535.16 18204.15 18898.66 10 12 13 14 15 16 d) Design the printing layout as close of the above example, for 30 years. e) All the programming style and compiling requirements applyExplanation / Answer
Explanation: If you need any other help for this Comment me below. Thanks Java code : public class Investment { double futureInvestmentValue(double investmentAmount, double monthlyInvestmentRate, int years) { double futureValue = investmentAmount * Math.pow(1 + monthlyInvestmentRate, years * 12); return futureValue; } void printFutureValueTable(double investmentAmount, double investmentRate) { System.out.println("Years Future Value"); double monthlyInvestmentRate = investmentRate/12; for (int i = 1; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.