finally project of workshop2

parent f84c76d5
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="2fc8dee6-dc07-4947-87ed-795929e1f6f3" name="Default Changelist" comment="" /> <list default="true" id="2fc8dee6-dc07-4947-87ed-795929e1f6f3" name="Default Changelist" comment="">
<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/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/University.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/University.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1YlMVyQSDFt0xYqw42aGbDN0Cjt" /> <component name="ProjectId" id="1YlMVyQSDFt0xYqw42aGbDN0Cjt" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" /> <option name="showExcludedFiles" value="true" />
...@@ -43,7 +52,8 @@ ...@@ -43,7 +52,8 @@
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1583512754291</updated> <updated>1583512754291</updated>
<workItem from="1583512755984" duration="4223000" /> <workItem from="1583512755984" duration="4839000" />
<workItem from="1583527493436" duration="808000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -51,21 +61,25 @@ ...@@ -51,21 +61,25 @@
<option name="version" value="1" /> <option name="version" value="1" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state width="1493" height="225" key="GridCell.Tab.0.bottom" timestamp="1583516632630"> <state width="1493" height="225" key="GridCell.Tab.0.bottom" timestamp="1583528305317">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1493" height="225" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1583528305317" />
<state width="1493" height="225" key="GridCell.Tab.0.center" timestamp="1583528305317">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="225" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1583516632630" /> <state width="1493" height="225" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1583528305317" />
<state width="1493" height="225" key="GridCell.Tab.0.center" timestamp="1583516632629"> <state width="1493" height="225" key="GridCell.Tab.0.left" timestamp="1583528305317">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="225" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1583516632629" /> <state width="1493" height="225" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1583528305317" />
<state width="1493" height="225" key="GridCell.Tab.0.left" timestamp="1583516632629"> <state width="1493" height="225" key="GridCell.Tab.0.right" timestamp="1583528305317">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="225" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1583516632629" /> <state width="1493" height="225" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1583528305317" />
<state width="1493" height="225" key="GridCell.Tab.0.right" timestamp="1583516632630"> <state x="465" y="238" key="com.intellij.ide.util.TipDialog" timestamp="1583527544630">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="225" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1583516632630" /> <state x="465" y="238" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1583527544630" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -66,10 +66,7 @@ public class Lab { ...@@ -66,10 +66,7 @@ public class Lab {
double sum = 0; double sum = 0;
int i; int i;
for(i = 0; i < currentSize; i++){ for(i = 0; i < currentSize; i++){
System.out.println((i+1)+")fName:"+students[i].getFirstName()); students[i].print();
System.out.println((i+1)+")lName:"+students[i].getLastName());
System.out.println((i+1)+")ID:"+students[i].getId());
System.out.println((i+1)+")grade:"+students[i].getGrade());
sum += students[i].getGrade(); sum += students[i].getGrade();
} }
double v = sum / i; double v = sum / i;
......
...@@ -26,19 +26,28 @@ public class Main { ...@@ -26,19 +26,28 @@ public class Main {
az[1] = new Lab(10, "Monday"); az[1] = new Lab(10, "Monday");
az[2] = new Lab(3, "Tuesday"); az[2] = new Lab(3, "Tuesday");
for(int i = 0; i < 3; i++){ az[0].enrollStudent(s[0]);
for(int j = 0; j < 3; j++){ az[0].enrollStudent(s[1]);
az[i].enrollStudent(s[j]); az[0].enrollStudent(s[2]);
} az[1].enrollStudent(s[3]);
} az[1].enrollStudent(s[4]);
az[1].enrollStudent(s[5]);
az[2].enrollStudent(s[6]);
az[2].enrollStudent(s[7]);
az[2].enrollStudent(s[8]);
University uni = new University("Computer Engineering", 3); University uni = new University("Computer Engineering", 3);
for(int i = 0; i < 3; i++){ for(int i = 0; i < 3; i++){
uni.enrollLab(az[i]); uni.enrollLab(az[i]);
} }
System.out.println("Name of university : "+uni.getName()); /*System.out.println("Name of university : "+uni.getName());
System.out.println("Number of labs : "+uni.getCurrentLab()); System.out.println("Number of labs : "+uni.getCurrentLab());
System.out.println("Capasity of university : "+uni.getSum()); System.out.println("Capasity of university : "+uni.getSum());
System.out.println("Average of all of students in university : "+uni.getAverage()); System.out.println("Average of all of students in university : "+uni.getAverage());*/
/*az[0].printMember();
az[1].printMember();
az[2].printMember();*/
uni.printInfo();
} }
} }
...@@ -62,5 +62,15 @@ public class University { ...@@ -62,5 +62,15 @@ public class University {
this.sum = sum; this.sum = sum;
} }
public void printInfo() {
double s = 0;
for(int i = 0; i < currentLab; i++) {
lab[i].printMember();
s += lab[i].getAvg();
}
double av = s / currentLab;
System.out.println("Average of university : "+av);
}
} }
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