Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BankAccounts;
- import java.time.LocalDate;
- import BankClients.Client;
- import BankPkg.AccountType;
- public class Student extends LoanableAccount {
- public Student(String name, int personId, LocalDate birthDate)
- throws Exception {
- this(new Client(name, personId, birthDate));
- }
- public Student(Client owner) throws Exception {
- super(owner, AccountType.student);
- }
- public Student(Student other) {
- super(other);
- }
- public boolean returnLoan() {
- double loanWithFee = this.loanAmount + this.calcFee(this.loanAmount);
- if (this.accountBalance >= loanWithFee) {
- this.accountBalance -= loanWithFee;
- this.loanAmount = 0;
- this.payments = 0;
- return true;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment