Program 4 - Student account Code the following program in Java. Only submit the source files. There will be two source files. Do not zip your project as it increases the marking time significantly. As a programmer you must be able to follow precise instructions. You will also not always get precise instructions. You must learn to ask questions and make valid deductions of what is expected. StudentAccount -studentName: String -studentCourse: String -balance: double +StudentAccount() +StudentAccount(String, String, double) +getters() +setters() +toString(): String +pay(double): double +addFees(double): double +refund(): void 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() an refund(). Use toString() to display the object's data after each method called.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question
A N 1
80% A 00:50
Program 4 - Stu..
Program 4 - Student account
Code the following program in Java. Only submit the source files. There will be two source files. Do
not zip your project as it increases the marking time significantly.
As a programmer you must be able to follow precise instructions. You will also not always get precise
instructions. You must learn to ask questions and make valid deductions of what is expected.
StudentAccount
-studentName: String
-studentCourse: String
-balance: double
+StudentAccount()
+StudentAccount(String, String, double)
+getters()
+setters()
+toString(): String
+pay(double): double
+addFees(double): double
+refund(): void
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() an
refund(). Use toString() to display the object's data after each method called.
Transcribed Image Text:A N 1 80% A 00:50 Program 4 - Stu.. Program 4 - Student account Code the following program in Java. Only submit the source files. There will be two source files. Do not zip your project as it increases the marking time significantly. As a programmer you must be able to follow precise instructions. You will also not always get precise instructions. You must learn to ask questions and make valid deductions of what is expected. StudentAccount -studentName: String -studentCourse: String -balance: double +StudentAccount() +StudentAccount(String, String, double) +getters() +setters() +toString(): String +pay(double): double +addFees(double): double +refund(): void 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() an 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 5 steps with 5 images

Blurred answer
Knowledge Booster
Constants and Variables
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT