Commit 28b46bfc authored by 9831045's avatar 9831045

added extra comments

parent e183b48f
......@@ -2,9 +2,6 @@
<project version="4">
<component name="ChangeListManager">
<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/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" />
......@@ -91,5 +88,9 @@
<screen x="0" y="0" width="1366" height="728" />
</state>
<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>
</project>
\ No newline at end of file
......@@ -21,6 +21,7 @@ public class Lab {
/**
* checks if the student can enroll to the class
* according to the current size and the capacity
*/
public void enrollment(Student std) {
if (currentSize < capacity) {
......@@ -33,7 +34,9 @@ public class Lab {
}
/**
* prints
* prints the students and
* also the average which is
* calculated
*/
public void print() {
/*
......@@ -87,7 +90,8 @@ public class Lab {
}
/**
* calculates the students average
* this method is used to
* calculate the students average
*/
public void calculateAvg() {
int sum = 0;
......
......@@ -33,8 +33,10 @@ public class Run {
std1.setGrade(20);
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");
//initializing the students in the array
......
......@@ -48,19 +48,43 @@ public class Student {
else
System.out.println("error grade");
}
/**
* a normal getter for grade
* @return grade which is the students grade
*/
public int getGrade(){
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
System.out.println("error");
}
/**
* a normal getter which returns the ID
* @return id which is the students ID
*/
public String getId(){
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(){
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