Overview

This lab gives you practice with the following java functionalities:

LEGEND: Keyboard    Screen

Task 1: SumOfNumbers

Based on task 1 on p. 242 of the textbook.

Task 2: MillionaireTimeline

Based on task 4 from page 242 of the text.

Thank you for using MillionaireTimeline! Your initial parameters were:

Current value:         $72,000.00
Projected growth rate:  10.0% per year
  
Year     Earnings      Total Value
----     --------      -----------
 0            -         $72,000.00
 1      $7,200.00       $79,200.00
 2      $7,920.00       $87,120.00
...     
27     $85,810.87      $943,919.58
28     $94,391.96    $1,038,311.54


Congratulations! After 28 years, you will be a millionaire! Your investment will be worth $1,038,311.54.

Challenge Tasks

  1. Update your SumOfNumbers program from task 1 above to do more robust checking of the user input. Before parsing the input as an integer, check to make sure that it has only digits (no decimal point or other characters). If the user enters something that cannot be parsed as an integer, inform them of the specific problem and allow them to fix it.
  2. Update MillionaireTimeline to accept one additional item from the user: an additional amount to be invested each year. Update the chart to include the added deposits.
Thank you for using MillionaireTimeline! Your initial parameters were:

Current value:         $72,000.00
Annual contribution:    $3,000.00
Projected growth rate:  10.0% per year
  
Year   Contribution     Earnings       Total Value
----   ------------     --------       -----------
 0            -               -         $72,000.00
 1       $3,000.00     $7,200.00        $82,200.00
 2       $3,000.00     $8,220.00        $93,420.00
...     
24       $3,000.00     $88.333.88      $974,672.73
25       $3,000.00     $97,467.27    $1,075,140.01


Congratulations! After 25 years, you will be a millionaire! Your investment will be worth $1,075,140.01.
Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement