super(pId, pFname, pLname);
}
//Override method calcTuition().
@Override
/**
* Method calcTuition returns nothing.
*/
public void calcTuition() {
double t;
if(getResidency() == RESIDENT) {
t = TuitionConstants.ONCAMP_RES_BASE;
}
else
{
t = TuitionConstants.ONCAMP_NONRES_BASE;
}
t = t + getProgramFee();
if(getCredits() > TuitionConstants.MAX_CREDITS) {
t = t +(getCredits()- TuitionConstants.MAX_CREDITS) *
TuitionConstants.ONCAMP_ADD_CREDITS;
}
setTuition(t);
}
// Program fee constructor.
public double getProgramFee() {
return mProgramFee;
}
//Residency constructor.
public int getResidency() {
return mResident;
}
//Mutator method for the program's fee.
public void setProgramFee(double pProgramFee) {
mProgramFee = pProgramFee;
public class OnCampusStudent extends Student {
// declarations of variables
protected static final int RESIDENT = 1;
protected static final int NON_RESIDENT = 2;
private int mResident;
private double mProgramFee;
/**
* OnCampusStudent constructor.
*/
public OnCampusStudent(String pId, String pFname, String pLname) {
//**********************************************************************
//**********************************
// CLASS: OnCampusStudent(OnCampusStudent.java)
//
// DESCRIPTION
// The logistics of finances if one is an on-campus student.
//
// COURSE AND PROJECT INFO
// CSE205 Object Oriented Programming and Data Structures, Summer-B 2019
// Project Number: 2
//
// AUTHOR
// Abderrazak Raouah
//
//**********************************************************************
//**********************************