I am trying to complete the Appendix attached Appendix. I just want to know if I am coding it correctly according to the Appendix and that I am using the correct approach. I am not sure if I did the correct thing under interest(). Where I called the super classes is that correct?
public interface LoanInterest { double interest(); String getName(); String toString(); } //end of LoanInterest public abstract class Student implements LoanInterest { private String name; private String studentNumber; private double feesOwed; public Student(String nm, String num, double amt) { name = nm; studentNumber = num; feesOwed = amt; } public double getFeesOwed() { return feesOwed; } public String getStudentNumber() { return studentNumber; } public String getName() { return name; } public String toString() { String msg; msg = String.format("%s\t%s\t%.2f", name, getStudentNumber(), getFeesOwed()); return msg; } } //end of Student public class UnderGrad extends Student { public UnderGrad(String nm, String num, double amt) { super(nm, num, amt); } public double interest() { return super.getFeesOwed() + (super.getFeesOwed() * 0.14); } } //end of UnderGrad public class PostGrad extends Student { private String diploma; public PostGrad(String nm, String num, double amt) { super(nm, num, amt); } public String getDiploma() { return diploma; } public double interest() { return super.getFeesOwed() + (super.getFeesOwed() * 0.14); } } //end of PostGrad