Commit 2c6b6869 authored by 9831045's avatar 9831045

Bug fixes

parent 88df324f
......@@ -2,7 +2,6 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="721d25be-807f-4a41-a78a-d223bc93b2f4" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Lab.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Lab.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Run.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Run.java" afterDir="false" />
......@@ -70,22 +69,22 @@
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="275" y="21" key="#Project_Structure/0.0.1366.728@0.0.1366.728" timestamp="1583492226195" />
<state width="1366" height="180" key="GridCell.Tab.0.bottom" timestamp="1583495551043">
<state width="1366" height="180" key="GridCell.Tab.0.bottom" timestamp="1583500264815">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1366" height="180" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1583495551043" />
<state width="1366" height="180" key="GridCell.Tab.0.center" timestamp="1583495551042">
<state width="1366" height="180" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1583500264815" />
<state width="1366" height="180" key="GridCell.Tab.0.center" timestamp="1583500264814">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1366" height="180" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1583495551042" />
<state width="1366" height="180" key="GridCell.Tab.0.left" timestamp="1583495551042">
<state width="1366" height="180" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1583500264814" />
<state width="1366" height="180" key="GridCell.Tab.0.left" timestamp="1583500264814">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1366" height="180" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1583495551042" />
<state width="1366" height="180" key="GridCell.Tab.0.right" timestamp="1583495551042">
<state width="1366" height="180" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1583500264814" />
<state width="1366" height="180" key="GridCell.Tab.0.right" timestamp="1583500264814">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1366" height="180" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1583495551042" />
<state width="1366" height="180" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1583500264814" />
<state x="184" y="0" key="SettingsEditor" timestamp="1583493438190">
<screen x="0" y="0" width="1366" height="728" />
</state>
......
......@@ -44,7 +44,7 @@ public class Lab {
}
*/
for (int i = 0; i < students.length; i++) {
for (int i = 0; i < capacity; i++) {
System.out.println("std fname: " + students[i].getFirstName() + " std id:" + students[i].getId() + " std grade:" + students[i].getGrade());
} System.out.println("Lab AVG:" + avg);
}
......@@ -65,9 +65,11 @@ public class Lab {
*/
public void setStudents(Student[] students) {
int j =0 ;
for (Studenti : students){
this.students[j] = i;
currentSize = 0;
for (Student i : students) {
this.students[j] = new Student(i.getFirstName(),i.getLastName(),i.getId());
j++;
currentSize++;
}
}
......@@ -121,6 +123,15 @@ public class Lab {
*/
public void setCapacity(int capacity) {
this.capacity = capacity;
}
}
/*
Student[] students1 = new Student[capacity];
for (int i = 0 ; i < students.length && i < capacity ; i++){
students1[i] = students[i];
......@@ -130,6 +141,4 @@ public class Lab {
students[i] = students1[i];
}
}
}
*/
\ No newline at end of file
......@@ -41,15 +41,24 @@ public class Run {
//now to show that no one can attend the lab when its full
Student std4 = new Student("new students first name","new students last name ","9031059");
lab.enrollment(std4);
//now lets increase the classes capacity
lab.setCapacity(4);
//the new lab student can be enrolled
lab.enrollment(std4);
//printing the labs new list
students = lab.getStudents();
students[0].print();
students[1].print();
students[2].print();
students[3].print();
lab.print();
}
}
......@@ -60,5 +60,8 @@ public class Student {
public String getId(){
return id;
}
public String getLastName(){
return lastName;
}
}
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