Department of Computer
Science
CMSC132:
Spring 2012
Project: GUI/Inner Classes
Due Date: Thursday Feb 23, 6:00 pm
Assignment Type: Open (See
Policy)
For this homework you will implement an interest calculator. A video of the calculator you need to implement can be found at Video.
Notice that there are no public/release/secret tests associated with this project. In addition, you do not need to provide any student tests.
Any clarifications or corrections associated with this project will be available at Clarifications.
For this project we are not providing any code (we just defined a package). We are providing an empty code distribution (available by checking out the project named InterestCalculator) so you can submit your project as usual. Feel free to add any classes/packages you understand you need. To simplify the grading process, make sure you have in the calculator package a class named InterestGUI.java. This class must have a main method that allow us to execute the calculator program.
You need to implement a GUI for a calculator that computes simple and compound interest. The formula to compute simple interest amount is:
simple interest amount = principal + (principal * (rate/100) * years)
The formula to compute compound interest amount is:
Compound Interest Amount = principal * (1 +
rate/100)Years
Notice that you do not need to add the principal in this case.
To display currency you can use the NumberFormat class (part of java.text) as follows:
String formattedValue =
NumberFormat.getCurrencyInstance().format(value);
where value represents the numeric value to format.
Additional requirements will be discussed in lecture.