Code the StudentAccount class according to the class diagram Methods explanation: pay(double): double This method is called when a student pays an amount towards outstanding fees. The balance is reduced by the amount received. The updated balance is returned by the method. addFees(double): double This method is called to increase the balance by the amount received as a parameter. The updated balance is returned by the method. refund(): void This method is called when any monies owned to the student is paid out. This method can only refund a student if the balance is negative. It displays the amount to be refunded and set the balance to zero. (Use Math.abs(double) in your output message). If there is no refund, display an appropriate message. Test your StudentAccount class by creating objects and calling the methods addFees(), pay() and refund(). Use toString() to display the object’s data after each method called
Code the StudentAccount class according to the class diagram
Methods explanation:
pay(double): double
This method is called when a student pays an amount towards outstanding fees. The balance is
reduced by the amount received. The updated balance is returned by the method.
addFees(double): double
This method is called to increase the balance by the amount received as a parameter. The updated
balance is returned by the method.
refund(): void
This method is called when any monies owned to the student is paid out. This method can only
refund a student if the balance is negative. It displays the amount to be refunded and set the
balance to zero. (Use Math.abs(double) in your output message). If there is no refund, display an
appropriate message.
Test your StudentAccount class by creating objects and calling the methods addFees(), pay() and
refund(). Use toString() to display the object’s data after each method called

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









