📄 registrarinterface.java
字号:
package Interfaces;
import dslib.list.LinkedListUos;
import Entities.*;
/** A registrar's interface is an extension of both the
instructor and student interface. */
public class RegistrarInterface extends InstructorInterface implements StudentInt
{
/** constructor */
public RegistrarInterface(){}
/** User input
Display the registrar's menu and get their selection */
public int getCommandID()
{
System.out.println("\n 1. Enroll a student in a course");
System.out.println(" 2. List courses in which a student is registered");
System.out.println(" 3. Change a student's PAC");
System.out.println(" 4. Withdraw a student from a course");
System.out.println(" 5. View a student's grades");
System.out.println(" 6. List open sections for a course");
System.out.println(" 7. Show amount that a student owes");
System.out.println(" 21. View a class list");
System.out.println(" 22. Check section enrollment");
System.out.println(" 60. Add course section");
System.out.println(" 61. Change section limit");
System.out.println(" 62. Change a student's grade");
System.out.println(" 63. Record a student's grade");
System.out.println(" 64. Record a student's payment");
System.out.println(" 99. Quit");
return (int)readInput("\n Enter choice : ");
}
public SectionDetails getSectionDetails()
{
int term = getTerm();
int limit = getLimit();
String days = getDay();
String time = getTime();
return new SectionDetails(term, time, days, limit);
}
/** Prompt the user for an enrollment limit */
public int getLimit()
{
return (int)readInput("\nEnter an enrollment limit : ");
}
/** Prompt the user for a course section */
public CourseSection getCourseSection()
{
int num = getSectionNumber();
return new CourseSection(num, getSectionDetails());
}
/** Prompt the user for a student's mark */
public String getStudentMark()
{
return readString("\nEnter the student's mark : ");
}
/** Get the amount the student paid */
public double getPayAmount()
{
return readInput("\nEnter the amount paid : ");
}
/** Get a term number from the user */
public int getTerm()
{
return (int)readInput("\nEnter the term : ");
}
/** Get a time for a class */
public String getTime()
{
return readString("\nEnter the time : ");
}
/** Get the day */
public String getDay()
{
return readString("\nEnter the days (MWF or TTH) : ");
}
/** Prompt the user for a personal access code */
public int getNewPAC()
{
return (int)readInput("\nEnter a new personal access code : ");
}
/** Show s's student number */
public void showStudentNumber(int num)
{
System.out.print("\nThe current student's number is " + num);
}
/** 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));
}
/** 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 : \n");
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);
}
}
} /* end of RegistrarInterface */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -