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

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,