Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2_MOUBARIK_GHITA_2_ELATRAS_GUFRAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MOUBARIK Ghita
2_MOUBARIK_GHITA_2_ELATRAS_GUFRAN
Commits
709602b2
Commit
709602b2
authored
Sep 17, 2020
by
GHITA999
Browse files
Options
Downloads
Patches
Plain Diff
debut01
parent
472fe343
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.idea/vcs.xml
+1
-1
1 addition, 1 deletion
.idea/vcs.xml
tp1/Grade.java
+6
-0
6 additions, 0 deletions
tp1/Grade.java
with
7 additions
and
1 deletion
.idea/vcs.xml
+
1
−
1
View file @
709602b2
<?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
This diff is collapsed.
Click to expand it.
tp1/Grade.java
+
6
−
0
View file @
709602b2
...
@@ -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
());
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment