⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 studentinterface.java

📁 国外的数据结构与算法分析用书
💻 JAVA
字号:
package Interfaces;

import dslib.list.LinkedListUos;

/**	This class defines an interface for a student */
public class StudentInterface extends UserInterface implements StudentInt
{
	/**	constructor */
	public StudentInterface(){}
	
	
	/**	get User input 
	Display the student menu and get their selection */
	public int getCommandID()
	{
		System.out.println("\n 1. Enroll in a course");
		System.out.println(" 2. List courses in which you are registered");
		System.out.println(" 3. Change PAC");
		System.out.println(" 4. Drop course");
		System.out.println(" 5. List grades");
		System.out.println(" 6. List open sections");
		System.out.println(" 7. Show amount owing");
		System.out.println(" 99. Quit");
		return (int)readInput("\n  Enter choice : ");
	}

	
	/**	Prompt the user for a student number */
	public int getStudentNumber()
	{
		return (int)readInput("\nEnter student number : ");
	}

	/**	Show information about fees */
	public void showFees(double amount, double paid)
	{	
		System.out.print("\n\nTotal fees  : " + amount);
		System.out.print("\nTotal paid  : " + paid);
		System.out.print("\n_________________________");
		System.out.println("\nTotal Owing : " + (amount - paid) + "\n");
	}
	
	/**	Display a list of courses for a student */
	public void showCourseList(LinkedListUos list)
	{
		if (list.isEmpty())
			System.out.println("\nNo Courses");
		else
		{
			System.out.println("\nCurrent courses are : ");
			showList(list);
		}
	}

	/**	Display a list a open course sections */
	public void showOpenSectionsList(LinkedListUos list)
	{
		if (list.isEmpty())
			System.out.println("\nNo current open sections");
		else
		{
			System.out.println("\nThe current open sections are : ");
			showList(list);
		}
	}
	
	/**	Prompt the user for a personal access code */
	public int getNewPAC()
	{
		return (int)readInput("\nEnter a new personal access code : ");
	}
	
} /* end of StudentInterface */

⌨️ 快捷键说明

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