studentreg.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 49 行

JAVA
49
字号
package Entities;

/**	Maintains information about registration in a section
	that a student requires. */
public class StudentReg
{
	/**	Data Attributes. */
	protected CallNum callNum;
	protected CourseReg courseReg;

	public StudentReg(CourseReg cr, CallNum cn)
	{
		callNum = cn;
		courseReg = cr;
	}

	/**	 Assign a grade for the student. */
	public void setGrade(String g)
	{
		courseReg.setGrade(g);
	}

	/**	Set the withdrawal date to be 'd'. */
	public void setWithdrawalDate(SimpleDate d)
	{
		courseReg.setWithdrawalDate(d);
	}

	/**	Return the section. */
	public CallNum callNum()
	{
		return callNum;
	}

	/**	Return the section. */
	public CourseReg courseReg()
	{
		return courseReg;
	}	

	public String toString()
	{
		String result = courseReg.toString();
		result += "Course Information ";
		result += callNum.toString();
		return result;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?