SE-0010 Introduction to Java
Lab 2: Interest Calculator

Outcomes

Assignment

For this assignment, you will write a program that computes the value of an interest-bearing CD (Certificate of Deposit) over a period of time. The initial value of the CD, the interest rate, and the period of time will all be determined by asking the user for those values.

Your program will consist of a single InterestCalculator class. For this assignment, this will be the only class needed. Within this class, you'll use several methods, as follows:

main method - this is the usual method where your program begins to execute when it is run, from within this method, you'll print a JOptionPane-based welcome screen, and after that, you'll call the following methods:

getInitialValue - this is a method that prompts the user for the initial value of the CD, converts that input to a numerical value, and returns that value to main().

getInterestRate - this is a method that prompts the user for the annual interest rate of the CD, converts that input to a numerical value, and returns that value to main().

getInterval - this is a method that prompts the user for the intervals (in years) at which the compounded value of the CD will be computed; it converts that input to a numerical value, and returns that value to main()

computeCDValue - this is the method that computes the value of the CD at a certain period of time (in years) after the original purchase. This method expects three arguments: the original purchase price of the CD, the annual interest rate, and the number of years since the CD was purchased. It computes the compounded value and returns that value to main(). From main(), you'll call this method 5 times, computing the value at 5 different intervals after purchase and storing the results in five different variables. For example, if the user entered 3 as the interval value, then you'll compute and store the CD compounded values at 3, 6, 9, 12, and 15 years after the original purchase date.

displayResults - this is the method that displays the results of the computations. This method expects five arguments: the five computed results of the compounded values of the CD at the five intervals. This method returns nothing back to main().

After you display the results, your program should end.

Detailed requirements

Test your program and make certain that it works correctly; use the results shown above to verify your output.

Remember: This is an individual assignment. While you may discuss the concepts with your classmates, you must write your own program. You may not copy or borrow code from your classmates.

Lab Submission (due 8:00am, Tuesday following lab)

Submit your completed Java program via via WebCT (assignment "Lab 2: Interest Calculator").. For this program, your program will consist of a single .java file.

Be sure to keep a copy of your work, in case something gets lost.

Your grade will be based on the following criteria: