Java Payment Calculator

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1459 Views - Last Post: 11 July 2011 - 03:03 PM Rate Topic: -----

#16 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1822
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Java Payment Calculator

Posted 11 July 2011 - 03:03 PM

Ok look at the signature of your method:
  public double calcMonthlyPayment(double principal, double interestYearly, int termYears){ 

It is supported to pass parameters (double,double,int)and return double. But look what you have done here:
   int payment = calcMonthlyPayment(principal, termYears / 100, interestYearly); 

You pass to it (double,int,double) and then you are assigning its value to int!!!!!!!
You have to change the definition of your method to be the same as what you want to pass or change the termYears to be int.

Also you have no displayMonthlyPayment(principal, termYears/100, interestYearly, payment) method!
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2