Commit f31bee9b authored by nargessalehi98's avatar nargessalehi98

First changes

parent d7804004
......@@ -124,9 +124,10 @@ public class Course {
public void printC() {
System.out.println("\nABOUT COURSE:Professor of course is:" + professor.getFirstName() +
"\nthe course's student are:" + getStudents() +
"\nthe course's capacity is :" + getCurrentCapacity() +
"\nthe course's lab is:" + getLabs());
"\nthe course's capacity is :" + getCurrentCapacity());
for (Student i : getStudents()) {
System.out.println("the students are :"+i.getFirstName());
}
}
}
......@@ -22,9 +22,9 @@ public class Faculty {
* @param name of faculty
*/
public Faculty(String name) {
students=new Student[10];
professors=new Professor[10];
courses=new Course[10];
students = new Student[10];
professors = new Professor[10];
courses = new Course[10];
this.name = name;
}
......@@ -115,6 +115,7 @@ public class Faculty {
}
return false;
}
/**
* @param course is a special course which is checking
* @return true of false
......@@ -125,20 +126,30 @@ public class Faculty {
}
return false;
}
/**
* @param professor name of special professor which is checking
* @return true of false
*/
public boolean isProfessorValid( Professor professor) {
public boolean isProfessorValid(Professor professor) {
for (Professor value : professors) {
return value == professor;
}
return false;
}
public void printF(){
System.out.println("\nABOUT FACULTY:the faculty name is :"+getName()+
"\nthe courses are:"+getCourses()+
"\nthe students are:"+getStudents()+
"\nthe professors are:"+getProfessors());
public void printF() {
System.out.println("\nABOUT FACULTY:the faculty name is :" + getName());
for (Course i : getCourses()) {
System.out.println("the students are :" + i.getName());
}
for (Student i : getStudents()) {
System.out.println("the students are :"+i.getFirstName());
}
for (Professor i : getProfessors()) {
System.out.println("the students are :"+i.getFirstName());
}
}
}
......@@ -106,8 +106,9 @@ public class Lab {
System.out.println("\nABOUT LAB:lab's TA is :"+TA+
"\nthe current sizs is:"+currentSize+
"\nthe day is :"+day+
"\nhas capacity:"+hasCapacity()+
"\nthe students are :"+getStudents()+
"\n");
"\nhas capacity:"+hasCapacity());
for (Student i : getStudents()) {
System.out.println("the students are :"+i.getFirstName());
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment