[SOLVED] Problems using if / else? Noobie! :-)
I'm slowly starting to get into this Java thing! But I have some problems using if / else.
I have an account. I need to write a method called transfer() which transfers an amount from an overpaymentBalance into currentBalance as long as annualPayments are = 0.0 and annualPayments are <= totalAllowedPerYear. When the overpaymentBalance is transfered, it should update the amount debited and update annualPayments with the credit.
If annualPayments are > 0.0 then no action should be taken.
The problem is that I have experience using if when an action is taken but I am unsure what to do if no action is taken?
The code I have so far is:
I am getting errors all over the place, including illegal start of the expression and expecting )... If you have any ideas I would be very grateful.
public void transfer()
credited = this.getOverpaymentBalance();
debited = this.getOverpaymentBalance() - credited;
if ((this.getAnnualDeposits() = 0.0) && this.gettotalAllowedPerYear() <= getMaxDepositPerYear())
if (this.getDepositsThisYear() > 0.0)
**unsure on action to take here**
All the best - FMJ.