Added courses
This commit is contained in:
		
							parent
							
								
									d46111b059
								
							
						
					
					
						commit
						3a2705794a
					
				
							
								
								
									
										11
									
								
								src/Course.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/Course.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					public enum Course {
 | 
				
			||||||
 | 
						EE201,
 | 
				
			||||||
 | 
						EE202,
 | 
				
			||||||
 | 
						IE201,
 | 
				
			||||||
 | 
						IE200,
 | 
				
			||||||
 | 
						ISLS201,
 | 
				
			||||||
 | 
						EE250
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,8 +1,11 @@
 | 
				
			|||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class Education {
 | 
					public class Education {
 | 
				
			||||||
	private String School;
 | 
						private String School;
 | 
				
			||||||
	private String Major;
 | 
						private String Major;
 | 
				
			||||||
	private Level level;
 | 
						private Level level;
 | 
				
			||||||
 | 
						private List<Course> courses = new ArrayList<Course>(6);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public Education(String school, String major, Level lvl) {
 | 
						public Education(String school, String major, Level lvl) {
 | 
				
			||||||
		School = school;
 | 
							School = school;
 | 
				
			||||||
@ -10,6 +13,31 @@ public class Education {
 | 
				
			|||||||
		level = lvl;
 | 
							level = lvl;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						public List<Course> getCourses() {
 | 
				
			||||||
 | 
							return courses;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void addCourse(Course course) {
 | 
				
			||||||
 | 
							this.courses.add(course);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public boolean addCourses(List<Course> courses) {
 | 
				
			||||||
 | 
							if (canAddCourse()) {
 | 
				
			||||||
 | 
								for (Course course : courses) {
 | 
				
			||||||
 | 
									this.courses.add(course);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return true;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public boolean canAddCourse() {
 | 
				
			||||||
 | 
							if (courses.size() == 6) {
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	public String getSchool() {
 | 
						public String getSchool() {
 | 
				
			||||||
		return School;
 | 
							return School;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -32,5 +60,11 @@ public class Education {
 | 
				
			|||||||
	public void setLevel(Level level) {
 | 
						public void setLevel(Level level) {
 | 
				
			||||||
		this.level = level;
 | 
							this.level = level;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public int numberOfCourses() {
 | 
				
			||||||
 | 
							return courses.size();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user