major75, glad one of my thoughts helped.
You can feel free to post the updated code if you have issues as I was ready to assist you to completion of the amortization piece. Think you appear to grasp everything that maybe the variables to use in method did the trick and you are good to go again. If not, you know where to find us.
Best regards and happy coding,
Kevin
Main Topics
Browse All Topics





by: mwvisa1Posted on 2009-11-01 at 15:52:04ID: 25716256
major75,
Glad to see you moving forward!
For the amortization you are now attempting, firstly I would adjust your signature for amortization method and your approach.
Remember, with methods you should be reducing code duplication as you can call this over again instead of writing repeatedly to do same work.
With that said, I would not pass Principle, MonthlyPayment and Balance here and then have to calculate interest rate, terms, etc. all over again.
public static void Amortization (double Principle, double MonthlyPayment, double Balance)
I was going to just jump in and make suggestions here, but actually better if you step back and advise me on how you want this to actual function. Are you wanting the amortization function to be called once and then loop inside to display all the payments? If so, then remove the duplicated work from main method. If you want to iteratively call amortization, then you may want to pass balance and interest rate already calculated in main since monthly payment, interest paid and principle paid are all determined from those two values.
Hope that makes sense.