Created
November 8, 2016 17:00
-
-
Save androidcodehunter/9f4f7957bd86786cd9cc2d3e40fa343e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.assignment; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
public class Student { | |
private int id; | |
private String name, gender; | |
private Date dateOfBirth; | |
private String email, postalAddress; | |
private int startYear, finishingYear; | |
private List<Student>students = new ArrayList<Student>(); | |
public Student(){ | |
} | |
public void addStudent(Student student){ | |
students.add(student); | |
} | |
public List<Student>getOlderStudent(int age){ | |
return null; | |
} | |
public List<Student>getYoungerStudent(int age){ | |
return null; | |
} | |
public int getId() { | |
return id; | |
} | |
public void setId(int id) { | |
this.id = id; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public String getGender() { | |
return gender; | |
} | |
public void setGender(String gender) { | |
this.gender = gender; | |
} | |
public Date getDateOfBirth() { | |
return dateOfBirth; | |
} | |
public void setDateOfBirth(Date dateOfBirth) { | |
this.dateOfBirth = dateOfBirth; | |
} | |
public String getEmail() { | |
return email; | |
} | |
public void setEmail(String email) { | |
this.email = email; | |
} | |
public String getPostalAddress() { | |
return postalAddress; | |
} | |
public void setPostalAddress(String postalAddress) { | |
this.postalAddress = postalAddress; | |
} | |
public int getStartYear() { | |
return startYear; | |
} | |
public void setStartYear(int startYear) { | |
this.startYear = startYear; | |
} | |
public int getFinishingYear() { | |
return finishingYear; | |
} | |
public void setFinishingYear(int finishingYear) { | |
this.finishingYear = finishingYear; | |
} | |
} | |
package com.assignment; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Module { | |
private String moduleName; | |
private List<Student>students = new ArrayList<Student>(); | |
public Module(){ | |
} | |
public String getModuleName() { | |
return moduleName; | |
} | |
public void setModuleName(String moduleName) { | |
this.moduleName = moduleName; | |
} | |
public void addStudent(Student student){ | |
students.add(student); | |
} | |
public void removeStudent(Student student){ | |
students.remove(student); | |
} | |
public int getStudentsCount(){ | |
return students.size(); | |
} | |
public List<Student> getStudents() { | |
return students; | |
} | |
public List<Student> getStudentsForGivenModule(Module module) { | |
return module.getStudents(); | |
} | |
} | |
package com.assignment; | |
public class Programmes { | |
private String programName; | |
public Programmes(){ | |
} | |
public String getProgramName() { | |
return programName; | |
} | |
public void setProgramName(String programName) { | |
this.programName = programName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment