|
HW9
Due: Monday 6/22/2009. (30 points)
Javabat
Complete the javabat problems in the Array-3 section.
Netbeans
You are to create a new Project called "BankLoan" which implement a simple loan service. The project should
contain the following class:
- Loan - this represents a loan.
It should have instance variables for the id number of the person taking
out the loan, the date of the loan, the initial loan amount, the
annual interest rate, the number of months it will be paid back, and an array of the payments so far.
It should have methods to make a payment, to print the payment history, to calculate the monthly payment
for the remaining months, and to calculate the payoff now (i.e. remaining principal + interest).
Also, provide several constructors. One which takes values for all of the instance variables
and another which takes only the user id number and a loan type number (where type 0 is a standard $10,000
loan at 12% interest for 60 months, and type 1 is a standard $25,000 loan at 6% for 15 years)
- LoanTest - this is a JUnit class containing test cases for the methods in Loan. You should write several
test cases for each of the "interesting" methods in Loan. The simple getter's and setters and constructors
only need one test.
For Monday, you don't need to get your program working. You can have minimal bodies for the methods in Loan.java
but you should write javadoc descriptions of each of the methods, constructors, variables, and the class; and
write test cases for all methods and constructors. You should start writing some of the constructors and methods
but do that after you have written the test class.
Ideally, you should do this using the NetBeans CollabEd tool set to "Live on Close" so that I can see the process
of how you wrote the class, not just the final result. For your group name use
- UNETIDloan
-
UNETIDloantest
where UNETID is your unetid in all CAPS.
If you can't get collabed to work, then just do it with netbeans and email me
the Java files.
This homework should give you an opportunity to design a Java class with instance variables and instance methods
and to apply the JUnit testing methodology to develop your program.
|