Question: Create an InvestmentComparison class that will contain a main method. Within the InvestmentComparison class: -Create three separate static methods to read and return a valid



Create an InvestmentComparison class that will contain a main method. Within the InvestmentComparison class: -Create three separate static methods to read and return a valid value for each user input (initial investment, annual interest rate, and term years). o Error check each of the above items is valid, using loops. - All three values must be at least 1. Define this amount as a class level constant. - Initial investment cannot be more than $500,000.00. - Annual interest cannot be more than 30%. -Terms can be up to (and including) 75 years. o Valid value upper limits for all items should be stored as local constant values. o For each item, within its method, loop and re-prompt the user until a valid value is entered. All error messages will use the constants to tell the user what values are valid.
Create another static method to read and return a valid compounding type choice from the user. o Let the user choose from a menu which compounding type will be compared to annual compounding (choices are: compounded quarterly, monthly, or daily). o A fourth menu choice, exit the program, should be included on the menu. o Loop, displaying the menu and reading the user choice, until the user enters a valid choice from the menu. -Create a main method that will: Display a description of what the program will do, for the user. Loop: o Call the method to read the compounding choice from the user
Unless the user chooses to Exit, continue: - Call the methods to ask the user for the initial investment, annual interest rate, and term years, and store the returned results. -Call the constructor to create two different objects of the Investment class type. Both objects will have the same initial investment, annual interest rate, and term years. But they will have different compounding periods. -The first Investment object will be created to use annual compounding. -For each object, call the instance method that will calculate its investment results. - For each object, call the instance method that will display its investment results. -Display a blank line. -Using whatever code is necessary, display the difference in the investment results, and then pause, as follows: The second Investment object will be created to use the compounding type chosen by the user from the menu.
When the user presses ENTER to continue, the program will loop and re-display the menu. o Continue looping and re-running the program, until the user chooses EXIT from the menu. o The program should ONLY exit when the user chooses EXIT from the menu. Do NOT ask the user if s/he wishes to run the program again just redisplay the menu each time until EXIT is chosen.
Compounding of an initial investment of 1000.00 yearly for 3 years at 4% annual interest. Calculate 4% of the current balance at the end of each year: End of year 1 : 1000.00 + 40.00 = 1040.00 End of year 2: 1040.0041.60- 1081.60 End of year 3: 1081.60 43.26 1124.86 Total earnings = 124.86 f an initial investment of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
