📄 coursereg.java
字号:
package Entities;
/** This class holds data regarding a students registration
into a specific section for a course. */
public class CourseReg
{
/** Make a new student course registration*/
public CourseReg(SimpleDate sDate, Student stud, String type)
{
regDate = sDate;
student = stud;
registrationType = type;
}
/** The registration date */
protected SimpleDate regDate;
/** The student grade */
protected String grade;
/** The date the student withdarw from course */
protected SimpleDate withdrawalDate;
/** The type of registration */
protected String registrationType;
/** The student registering */
protected Student student;
/** Return the registration date */
public SimpleDate regDate()
{
return regDate;
}
/** Return the date the student withdarw from course */
public SimpleDate withdrawalDate()
{
return withdrawalDate;
}
/** Return the type of registration */
public String registrationType()
{
return registrationType;
}
/** Return the student registering */
public Student student()
{
return student;
}
/** Return the grade assign to the course taken */
public String grade()
{
return grade;
}
/** Assign a grade for the student */
public void setGrade(String g)
{
grade = g;
}
/** Set the withdrawal date to be 'd' */
public void setWithdrawalDate(SimpleDate d)
{
withdrawalDate = d;
}
public String toString()
{
String result = "\n" + student;
result += "\nRegistration Date : " + regDate;
if (withdrawalDate != null)
{
result += "\nTHIS STUDENT HAS WITHDRAWN FROM THE COURSE";
result += "\nWithdrawal date : " + withdrawalDate;
}
return (result + "\n");
}
} /* end of CourseReg */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -