Department of Computer
Science
CMSC132:
Spring 2019
Project: GUI/Inner Classes
Due Date: Wednesday 03/06, 11:00PM
Assignment Type: Open (See
Policy)
For this project 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. We will test your work by running the project manually. You do not need to provide any student tests.
This project is designed to help you develop your skills at defining inner classes and simple GUIs.
For this project we are not providing any code (we just defined a package and an empty class). We are providing an empty code distribution (available by importing the project named 132Spring19Project4) so you can submit your project as usual. Feel free to add any additional classes if you want them. 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 allows 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);