Commit 28b46bfc authored by 9831045's avatar 9831045

added extra comments

parent e183b48f
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="721d25be-807f-4a41-a78a-d223bc93b2f4" name="Default Changelist" comment=""> <list default="true" id="721d25be-807f-4a41-a78a-d223bc93b2f4" 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$/out/production/Run/Lab.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/Run/Lab.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/Run/Run.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/Run/Run.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Lab.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Lab.java" 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" /> <change beforePath="$PROJECT_DIR$/src/Run.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Run.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Student.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Student.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Student.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Student.java" afterDir="false" />
...@@ -91,5 +88,9 @@ ...@@ -91,5 +88,9 @@
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="184" y="0" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1583493438190" /> <state x="184" y="0" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1583493438190" />
<state x="346" y="49" width="672" height="678" key="search.everywhere.popup" timestamp="1583505236397">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="346" y="49" width="672" height="678" key="search.everywhere.popup/0.0.1366.728@0.0.1366.728" timestamp="1583505236397" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -21,6 +21,7 @@ public class Lab { ...@@ -21,6 +21,7 @@ public class Lab {
/** /**
* checks if the student can enroll to the class * checks if the student can enroll to the class
* according to the current size and the capacity
*/ */
public void enrollment(Student std) { public void enrollment(Student std) {
if (currentSize < capacity) { if (currentSize < capacity) {
...@@ -33,7 +34,9 @@ public class Lab { ...@@ -33,7 +34,9 @@ public class Lab {
} }
/** /**
* prints * prints the students and
* also the average which is
* calculated
*/ */
public void print() { public void print() {
/* /*
...@@ -87,7 +90,8 @@ public class Lab { ...@@ -87,7 +90,8 @@ public class Lab {
} }
/** /**
* calculates the students average * this method is used to
* calculate the students average
*/ */
public void calculateAvg() { public void calculateAvg() {
int sum = 0; int sum = 0;
......
...@@ -33,8 +33,10 @@ public class Run { ...@@ -33,8 +33,10 @@ public class Run {
std1.setGrade(20); std1.setGrade(20);
std2.setGrade(19); std2.setGrade(19);
//setting an invalid ID which result in an error because it has 8 digits
std3.setId("98328392");
//setting the new ID //setting the new valid ID
std3.setId("9034212"); std3.setId("9034212");
//initializing the students in the array //initializing the students in the array
......
...@@ -48,19 +48,43 @@ public class Student { ...@@ -48,19 +48,43 @@ public class Student {
else else
System.out.println("error grade"); System.out.println("error grade");
} }
/**
* a normal getter for grade
* @return grade which is the students grade
*/
public int getGrade(){ public int getGrade(){
return grade; return grade;
} }
public void setId(String fId){
if( fId.length() == 7 ) { /**
id = fId; * this method will reset the students ID
* according to its digit counts if the input
* has more or less than 7 digits the method
* will print an error
* @param id is the new student ID
*/
public void setId(String id){
if( id.length() == 7 ) {
this.id = id;
} }
else else
System.out.println("error"); System.out.println("error");
} }
/**
* a normal getter which returns the ID
* @return id which is the students ID
*/
public String getId(){ public String getId(){
return id; return id;
} }
/**
* getLastName method is used to return the students last name
* @return lastName which is the students last name
* and is used in the Lab class
*/
public String getLastName(){ public String getLastName(){
return lastName; 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