Skip to content
Snippets Groups Projects
Commit 709602b2 authored by GHITA999's avatar GHITA999
Browse files

debut01

parent 472fe343
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -28,6 +28,7 @@ public class Grade { ...@@ -28,6 +28,7 @@ public class Grade {
*/ */
public double getValue() { public double getValue() {
return value;
} }
/** /**
...@@ -36,6 +37,7 @@ public class Grade { ...@@ -36,6 +37,7 @@ public class Grade {
*/ */
@Override @Override
public String toString() { public String toString() {
return (value+"/20");
} }
/** /**
...@@ -46,6 +48,10 @@ public class Grade { ...@@ -46,6 +48,10 @@ public class Grade {
* @return a grade corresponding to the mean of grade in {@code grades} * @return a grade corresponding to the mean of grade in {@code grades}
*/ */
public static Grade averageGrade(List<Grade> grades){ public static Grade averageGrade(List<Grade> grades){
double cumul=0.0;
for (Grade grade : grades){
cumul += grade.getValue();
}return new Grade (cumul/grades.size());
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment