亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? section.java

?? 學(xué)生注冊系統(tǒng)SRS 允許學(xué)生在線注冊每學(xué)期的課程并記錄學(xué)位完成的進度
?? JAVA
字號:
// Section.java - Chapter 14, Java 5 version.

// Copyright 2005 by Jacquie Barker - all rights reserved.

// A MODEL class.


import java.util.ArrayList;
import java.util.HashMap;

public class Section {
	//------------
	// Attributes.
	//------------

	private int sectionNo;
	private char dayOfWeek;
	private String timeOfDay;
	private String room;
	private int seatingCapacity;
	private Course representedCourse;
	private ScheduleOfClasses offeredIn;
	private Professor instructor;

	// The enrolledStudents HashMap stores Student object references,
	// using each Student's ssn as a String key.

	private HashMap<String, Student> enrolledStudents; 

	// The assignedGrades HashMap stores TranscriptEntry object
	// references, using a reference to the Student to whom it belongs 
	// as the key.

	private HashMap<Student, TranscriptEntry> assignedGrades; 
	
	//----------------
	// Constructor(s).
	//----------------

	public Section(int sNo, char day, String time, Course course,
		       String room, int capacity) {
		setSectionNo(sNo);
		setDayOfWeek(day);
		setTimeOfDay(time);
		setRepresentedCourse(course);
		setRoom(room);
		setSeatingCapacity(capacity);

		// A Professor has not yet been identified.

		setInstructor(null);

		// Note that we're instantiating empty support Collection(s).

		enrolledStudents = new HashMap<String, Student>();
		assignedGrades = new HashMap<Student, TranscriptEntry>();
	}
									
	//------------------
	// Accessor methods.
	//------------------

	public void setSectionNo(int no) {
		sectionNo = no;
	}
	
	public int getSectionNo() {
		return sectionNo;
	}
	
	public void setDayOfWeek(char day) {
		dayOfWeek = day;
	}
	
	public char getDayOfWeek() {
		return dayOfWeek;
	}
		
	public void setTimeOfDay(String time) {
		timeOfDay = time;
	}
	
	public String getTimeOfDay() {
		return timeOfDay;
	}

	public void setInstructor(Professor prof) {
		instructor = prof;
	}
	
	public Professor getInstructor() {
		return instructor;
	}
	
	public void setRepresentedCourse(Course c) {
		representedCourse = c;
	}
	
	public Course getRepresentedCourse() {
		return representedCourse;
	}		

	public void setRoom(String r) {
		room = r;
	}

	public String getRoom() {
		return room;
	}

	public void setSeatingCapacity(int c) {
		seatingCapacity = c;
	}

	public int getSeatingCapacity() {
		return seatingCapacity;
	}

	public void setOfferedIn(ScheduleOfClasses soc) {
		offeredIn = soc;
	}

	public ScheduleOfClasses getOfferedIn() {
		return offeredIn;
	}	

	//-----------------------------
	// Miscellaneous other methods.
	//-----------------------------

	// For a Section, we want its String representation to look
	// as follows:
	//
	//	MATH101 - 1 - M - 8:00 AM

	public String toString() {
		return getRepresentedCourse().getCourseNo() + " - " +
		       getSectionNo() + " - " +
		       getDayOfWeek() + " - " +
		       getTimeOfDay();
	}

	// The full section number is a concatenation of the
	// course no. and section no., separated by a hyphen;
	// e.g., "ART101 - 1".

	public String getFullSectionNo() {
		return getRepresentedCourse().getCourseNo() + 
		       " - " + getSectionNo();
	}

	// We use an enum -- EnrollmentStatus -- to return an indication of the
	// outcome of the request to enroll Student s.  See EnrollmentStatus.java
	// for details on this enum.

	public EnrollmentStatus enroll(Student s) {
		// First, make sure that this Student is not already
		// enrolled for this Section, and that he/she has
		// NEVER taken and passed the course before.  
		
		Transcript transcript = s.getTranscript();

		if (s.isCurrentlyEnrolledInSimilar(this) || 
		    transcript.verifyCompletion(this.getRepresentedCourse())) {
			return EnrollmentStatus.prevEnroll;
		}

		// If there are any prerequisites for this course,
		// check to ensure that the Student has completed them.

		Course c = this.getRepresentedCourse();
		if (c.hasPrerequisites()) {
			for (Course pre : c.getPrerequisites()) {
				// See if the Student's Transcript reflects
				// successful completion of the prerequisite.

				if (!transcript.verifyCompletion(pre)) {
					return EnrollmentStatus.prereq;
				}
			}
		}
		
		// If the total enrollment is already at the
		// the capacity for this Section, we reject this 
		// enrollment request.

		if (!this.confirmSeatAvailability()) {
			return EnrollmentStatus.secFull;
		}
		
		// If we made it to here in the code, we're ready to
		// officially enroll the Student.

		// Note bidirectionality:  this Section holds
		// onto the Student via the HashMap, and then
		// the Student is given a handle on this Section.

		enrolledStudents.put(s.getSsn(), s);
		s.addSection(this);

		return EnrollmentStatus.success;
	}
	
	// A private "housekeeping" method.

	private boolean confirmSeatAvailability() {
		if (enrolledStudents.size() < getSeatingCapacity()) return true;
		else return false;
	}

	public boolean drop(Student s) {
		// We may only drop a student if he/she is enrolled.

		if (!s.isEnrolledIn(this)) return false;
		else {
			// Find the student in our HashMap, and remove it.

			enrolledStudents.remove(s.getSsn());

			// Note bidirectionality.

			s.dropSection(this);
			return true;
		}
	}

	public int getTotalEnrollment() {
		return enrolledStudents.size();
	}	

	public void display() {
		System.out.println("Section Information:");
		System.out.println("\tSemester:  " + getOfferedIn().getSemester());
		System.out.println("\tCourse No.:  " + 
				   getRepresentedCourse().getCourseNo());
		System.out.println("\tSection No:  " + getSectionNo());
		System.out.println("\tOffered:  " + getDayOfWeek() + 
				   " at " + getTimeOfDay());
		System.out.println("\tIn Room:  " + getRoom());
		if (getInstructor() != null) 
			System.out.println("\tProfessor:  " + 
				   getInstructor().getName());
		displayStudentRoster();
	}
	
	public void displayStudentRoster() {
		System.out.print("\tTotal of " + getTotalEnrollment() + 
				   " students enrolled");

		// How we punctuate the preceding message depends on 
		// how many students are enrolled (note that we used
		// a print() vs. println() call above).

		if (getTotalEnrollment() == 0) System.out.println(".");
		else System.out.println(", as follows:");

		// Iterate through all of the values stored in the HashMap.

		for (Student s : enrolledStudents.values()) {
			System.out.println("\t\t" + s.getName());
		}
	}

	// This method returns the value null if the Student has not
	// been assigned a grade.

	public String getGrade(Student s) {
		String grade = null;

		// Retrieve the associated TranscriptEntry object for this specific 
		// student from the assignedGrades HashMap, if one exists, and in turn 
		// retrieve its assigned grade.

		TranscriptEntry te = assignedGrades.get(s);
		if (te != null) {
			grade = te.getGrade(); 
		}

		// If we found no TranscriptEntry for this Student, a null value
		// will be returned to signal this.

		return grade;
	}

	public boolean postGrade(Student s, String grade) {
		// First, validate that the grade is properly formed by calling
		// a utility method provided by the TranscriptEntry class.

		if (!TranscriptEntry.validateGrade(grade)) return false;

		// Make sure that we haven't previously assigned a
		// grade to this Student by looking in the HashMap
		// for an entry using this Student as the key.  If
		// we discover that a grade has already been assigned,
		// we return a value of false to indicate that
		// we are at risk of overwriting an existing grade.  
		// (A different method, eraseGrade(), can then be written
		// to allow a Professor to change his/her mind.)

		if (assignedGrades.get(s) != null) return false;

		// First, we create a new TranscriptEntry object.  Note
		// that we are passing in a reference to THIS Section,
		// because we want the TranscriptEntry object,
		// as an association class ..., to maintain
		// "handles" on the Section as well as on the Student.
		// (We'll let the TranscriptEntry constructor take care of
		// linking this T.E. to the correct Transcript.)

		TranscriptEntry te = new TranscriptEntry(s, grade, this);

		// Then, we "remember" this grade because we wish for
		// the connection between a T.E. and a Section to be
		// bidirectional.

		assignedGrades.put(s, te);

		return true;
	}
	
	public boolean isSectionOf(Course c) {
		if (c == representedCourse) return true;
		else return false;
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区四区 | 日韩激情中文字幕| 99国内精品久久| 亚洲日本免费电影| 欧美午夜电影在线播放| 亚洲一区二区三区三| 欧美日韩久久一区二区| 污片在线观看一区二区| 91麻豆精品国产自产在线观看一区| 日产精品久久久久久久性色| 日韩一区二区精品| 成人一区在线观看| 国产精品毛片a∨一区二区三区| jlzzjlzz欧美大全| 天天免费综合色| 2017欧美狠狠色| 一本色道a无线码一区v| 亚洲va欧美va人人爽| 欧美r级在线观看| 99久久久精品| 三级在线观看一区二区| 国产午夜精品一区二区| 色欧美日韩亚洲| 美女久久久精品| 亚洲视频你懂的| 日韩欧美中文字幕精品| 99久久免费精品高清特色大片| 亚洲第一成人在线| 久久精品男人天堂av| 在线免费观看一区| 国产一区二区三区在线看麻豆| 亚洲免费高清视频在线| 日韩一二三区视频| 色哟哟一区二区在线观看 | 精品成人私密视频| 色综合一区二区三区| 日一区二区三区| 国产精品久久久久影院亚瑟| 欧美一区午夜视频在线观看| 粉嫩aⅴ一区二区三区四区| 亚洲成av人片一区二区三区| 国产精品伦理一区二区| 欧美一区2区视频在线观看| 91麻豆视频网站| 国产在线不卡一卡二卡三卡四卡| 一个色在线综合| 欧美国产一区二区在线观看| 777亚洲妇女| 91网站在线观看视频| 国内精品嫩模私拍在线| 日韩激情视频网站| 一区二区欧美视频| 亚洲欧洲日产国产综合网| 精品国产免费视频| 欧美日韩二区三区| 91麻豆国产在线观看| 国产91精品久久久久久久网曝门 | 国产精品88av| 裸体在线国模精品偷拍| 亚洲成人黄色小说| 亚洲亚洲精品在线观看| 亚洲人妖av一区二区| 欧美经典一区二区| 久久久久综合网| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 捆绑调教美女网站视频一区| 亚洲综合一区在线| 亚洲精品国久久99热| 国产精品无圣光一区二区| 久久免费美女视频| 久久亚洲影视婷婷| 国产亚洲精品免费| 久久久影院官网| 久久色在线观看| 欧美精品一区二区三区蜜桃| 日韩欧美亚洲国产另类| 日韩欧美综合在线| 精品国产一区久久| 久久精品视频一区| 欧美激情一区二区| 国产精品乱码一区二三区小蝌蚪| 日本一区二区免费在线| 国产精品乱码一区二区三区软件| 国产精品乱码人人做人人爱| 亚洲天堂精品视频| 樱桃国产成人精品视频| 亚洲小说欧美激情另类| 日韩1区2区3区| 精品一区中文字幕| 国产成人av福利| 成年人国产精品| 在线免费精品视频| 欧美精品久久一区| 欧美tk丨vk视频| 国产精品日日摸夜夜摸av| 国产精品乱码人人做人人爱| 亚洲免费成人av| 日韩av网站在线观看| 久久电影网站中文字幕| 国产成人自拍高清视频在线免费播放 | 久久这里都是精品| 亚洲欧洲精品一区二区精品久久久 | 欧美在线播放高清精品| 欧美精品电影在线播放| 日韩你懂的电影在线观看| 久久九九久久九九| 国产精品理伦片| 亚洲第一搞黄网站| 国产伦精品一区二区三区视频青涩 | 舔着乳尖日韩一区| 国内偷窥港台综合视频在线播放| 波多野结衣在线一区| 在线观看三级视频欧美| 日韩午夜激情免费电影| 欧美激情一区在线观看| 亚洲二区视频在线| 国产一区福利在线| 欧美中文字幕一区二区三区亚洲| 日韩精品一区二区三区视频播放| 国产精品你懂的| 人禽交欧美网站| 91在线云播放| 日韩欧美亚洲国产精品字幕久久久| 亚洲国产精品精华液ab| 亚洲va国产天堂va久久en| 国产精品综合在线视频| 在线国产亚洲欧美| 久久精品视频一区二区| 午夜私人影院久久久久| 粉嫩av一区二区三区粉嫩| 欧美精品在线观看一区二区| 国产喷白浆一区二区三区| 亚洲mv在线观看| 成人免费视频视频| 精品国产乱码久久久久久牛牛 | 国产98色在线|日韩| 欧美人妇做爰xxxⅹ性高电影 | 狠狠网亚洲精品| 欧美三区免费完整视频在线观看| 久久网站最新地址| 日韩国产欧美在线视频| 色www精品视频在线观看| 国产天堂亚洲国产碰碰| 精品一区二区三区在线视频| 欧美丝袜自拍制服另类| 国产精品美女久久久久久久网站| 美女精品一区二区| 777a∨成人精品桃花网| 亚洲黄色av一区| av毛片久久久久**hd| 久久久久久久久蜜桃| 美女性感视频久久| 欧美日韩国产一区| 亚洲综合免费观看高清在线观看| 成人美女视频在线看| 国产性色一区二区| 九一久久久久久| 欧美岛国在线观看| 久久精品噜噜噜成人av农村| 宅男在线国产精品| 日韩激情视频在线观看| 欧美高清激情brazzers| 亚洲不卡av一区二区三区| 欧美在线999| 亚洲福中文字幕伊人影院| 欧美色网站导航| 亚洲午夜日本在线观看| 欧日韩精品视频| 亚洲国产欧美在线| 欧美日韩一级二级| 爽爽淫人综合网网站| 91精品在线一区二区| 亚欧色一区w666天堂| 欧美高清hd18日本| 免费精品视频在线| 精品日产卡一卡二卡麻豆| 国内精品久久久久影院一蜜桃| 欧美精品一区二区三区视频| 国产美女视频一区| 国产精品国产三级国产| 91片黄在线观看| 亚洲午夜视频在线观看| 51精品秘密在线观看| 日本午夜精品视频在线观看| 日韩精品一区在线观看| 国产一区二区不卡在线| 国产精品久久久久久久久免费丝袜| 成人av在线网站| 亚洲国产一区视频| 日韩精品一区二| 成人精品视频一区二区三区尤物| 亚洲精品成a人| 91精品国产综合久久婷婷香蕉| 精品一区二区精品| 国产精品免费av| 欧美日韩精品系列| 久久成人免费电影| 亚洲色图欧洲色图| 欧美视频精品在线观看| 久久se这里有精品|