Homework 5

Output Requirements

Generate an investment report showing the nominal rate, the time in years, the compounding frequency, the present value, the future value, and the interest earned for a one-time investment earning compound interest. The output should be formatted as illustrated in the report section of the sample run shown below:

Sample Run

Notice that the nominal rate is displayed to three decimal places in the report and that dollar amounts (present value, future value, and interest) are displayed to the nearest penny in a field ten characters wide.

Input Requirements

Ask the user to enter the present value, the nominal rate (as a percent), the time in years, and the compounding frequency. You may assume that the user will enter valid values. Your program should display the instructions for using the program and suitable prompts as shown in the sample run above.

Miscellaneous Requirements

Using Windows Explorer, copy your Investment.java file from your Lab04 project folder into your Hmwk05 project folder. This makes the Investment class available to your application. Your application should use an Investment object to store the investment parameters. Your application should get the specified output values from this Investment object. Be sure to make any necessary corrections to your Investment class before submitting it again for this project.

Formatted Output

Formatted output can be generated using the format method of the PrintStream class or the String class.

Submitting Your Work

Send both your Hmwk05.java application file and your Investment.java file to me as attachments to an email message whose subject is "Hmwk05".