| Author |
Java GUI loan and payment calculator help
|
mike saggese
Greenhorn
Joined: Nov 27, 2012
Posts: 8
|
|
hey there, I'm new to Java and I need help with this assignment: Write a Java program to calculate and display monthly and total payments given interest starting from 3% to 6% (with an increment of 0.125%). The user inputs are loan amount and loan period (i.e., number of years).
Here's what I have so far
I also have this code as reference to what I want to do but isn't exactly how I want it done
If anyone can help me make heads or tails of anything that would be great thanks
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3031
|
|
|
Do you have a problem or question with the code? Are you stuck someplace? TellTheDetails (<-link)
|
Steve
|
 |
mike saggese
Greenhorn
Joined: Nov 27, 2012
Posts: 8
|
|
Steve Luke wrote:Do you have a problem or question with the code? Are you stuck someplace? TellTheDetails (<-link)
Yes. My gripe is where do I put the interest rate and monthly payment and total payment formula for the show table button to calculate the loan?
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3031
|
|
My suggestion would be in a different class. Have a class whose sole purpose is to maintain a balance, total term, take a percentage rate as a value, and generate the payment amount.
I would create a small gui-less example (like the second code) to test out the class to make sure that the class does what you need it to do.
Then I would use the information learned from the gui-less example (i.e. what methods have to be called in what order) to generate the functionality of your actionPerformed method in your GUI.
|
 |
mike saggese
Greenhorn
Joined: Nov 27, 2012
Posts: 8
|
|
Steve Luke wrote:My suggestion would be in a different class. Have a class whose sole purpose is to maintain a balance, total term, take a percentage rate as a value, and generate the payment amount.
I would create a small gui-less example (like the second code) to test out the class to make sure that the class does what you need it to do.
Then I would use the information learned from the gui-less example (i.e. what methods have to be called in what order) to generate the functionality of your actionPerformed method in your GUI.
I did a little more with the code. How about this?
for some reason however I keep getting an error on line 81 saying illegal start of expression. how do I fix that?
|
 |
Amit Ghorpade
Bartender
Joined: Jun 06, 2007
Posts: 2551
|
|
mike saggese wrote:for some reason however I keep getting an error on line 81 saying illegal start of expression. how do I fix that?
Look at line 81 carefully, you are declaring the incrementRate() without ending actionPerformed().
|
SCJP, SCWCD.
|Asking Good Questions|
|
 |
 |
|
|
subject: Java GUI loan and payment calculator help
|
|
|