Commit f31bee9b authored by nargessalehi98's avatar nargessalehi98

First changes

parent d7804004
...@@ -124,9 +124,10 @@ public class Course { ...@@ -124,9 +124,10 @@ public class Course {
public void printC() { public void printC() {
System.out.println("\nABOUT COURSE:Professor of course is:" + professor.getFirstName() + 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 capacity is :" + getCurrentCapacity() + for (Student i : getStudents()) {
"\nthe course's lab is:" + getLabs()); System.out.println("the students are :"+i.getFirstName());
}
} }
} }
...@@ -22,9 +22,9 @@ public class Faculty { ...@@ -22,9 +22,9 @@ public class Faculty {
* @param name of faculty * @param name of faculty
*/ */
public Faculty(String name) { public Faculty(String name) {
students=new Student[10]; students = new Student[10];
professors=new Professor[10]; professors = new Professor[10];
courses=new Course[10]; courses = new Course[10];
this.name = name; this.name = name;
} }
...@@ -115,6 +115,7 @@ public class Faculty { ...@@ -115,6 +115,7 @@ public class Faculty {
} }
return false; return false;
} }
/** /**
* @param course is a special course which is checking * @param course is a special course which is checking
* @return true of false * @return true of false
...@@ -125,20 +126,30 @@ public class Faculty { ...@@ -125,20 +126,30 @@ public class Faculty {
} }
return false; return false;
} }
/** /**
* @param professor name of special professor which is checking * @param professor name of special professor which is checking
* @return true of false * @return true of false
*/ */
public boolean isProfessorValid( Professor professor) { public boolean isProfessorValid(Professor professor) {
for (Professor value : professors) { for (Professor value : professors) {
return value == professor; return value == professor;
} }
return false; return false;
} }
public void printF(){
System.out.println("\nABOUT FACULTY:the faculty name is :"+getName()+ public void printF() {
"\nthe courses are:"+getCourses()+ System.out.println("\nABOUT FACULTY:the faculty name is :" + getName());
"\nthe students are:"+getStudents()+ for (Course i : getCourses()) {
"\nthe professors are:"+getProfessors()); 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 { ...@@ -106,8 +106,9 @@ public class Lab {
System.out.println("\nABOUT LAB:lab's TA is :"+TA+ System.out.println("\nABOUT LAB:lab's TA is :"+TA+
"\nthe current sizs is:"+currentSize+ "\nthe current sizs is:"+currentSize+
"\nthe day is :"+day+ "\nthe day is :"+day+
"\nhas capacity:"+hasCapacity()+ "\nhas capacity:"+hasCapacity());
"\nthe students are :"+getStudents()+ for (Student i : getStudents()) {
"\n"); 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