Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Programmation2
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
SEREME Tomas
Programmation2
Commits
2961496e
Commit
2961496e
authored
Sep 20, 2020
by
SEREME Tomas
Browse files
Options
Downloads
Patches
Plain Diff
Modidication des classes cohort
parent
b9bfe82c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tp1/Cohort.java
+12
-0
12 additions, 0 deletions
tp1/Cohort.java
tp1/Main.java
+10
-0
10 additions, 0 deletions
tp1/Main.java
tp1/TeachingUnitResult.java
+2
-0
2 additions, 0 deletions
tp1/TeachingUnitResult.java
with
24 additions
and
0 deletions
tp1/Cohort.java
+
12
−
0
View file @
2961496e
...
...
@@ -24,6 +24,8 @@ public class Cohort {
* @param student the student to be added to the cohort
*/
public
void
addStudent
(
Student
student
){
students
.
add
(
student
);
}
/**
...
...
@@ -31,6 +33,7 @@ public class Cohort {
* @return the list of students of the cohort.
*/
public
List
<
Student
>
getStudents
(){
return
List
.
copyOf
(
students
);
}
/**
...
...
@@ -38,9 +41,17 @@ public class Cohort {
* grade.
*/
public
void
printStudentsResults
(){
printName
();
System
.
out
.
println
();
for
(
Student
student
:
students
){
student
.
printResults
();
System
.
out
.
println
();
}
}
private
void
printName
(){
System
.
out
.
println
(
this
.
toString
());
}
/**
...
...
@@ -49,5 +60,6 @@ public class Cohort {
*/
@Override
public
String
toString
()
{
return
name
;
}
}
This diff is collapsed.
Click to expand it.
tp1/Main.java
+
10
−
0
View file @
2961496e
public
class
Main
{
public
static
void
main
(
String
[]
args
){
Student
student1
=
new
Student
(
"Tomas"
,
"Sereme"
);
Student
student2
=
new
Student
(
"Zidani fahed"
,
"Imed"
);
student1
.
addResult
(
"programmation2"
,
new
Grade
(
20
));
student2
.
addResult
(
"programmation2"
,
new
Grade
(
0
));
student1
.
addResult
(
"Structures discretes"
,
new
Grade
(
20
));
student2
.
addResult
(
"Structures discretes"
,
new
Grade
(
0
));
Cohort
cohort
=
new
Cohort
(
"L2 informatique"
);
cohort
.
addStudent
(
student1
);
cohort
.
addStudent
(
student2
);
cohort
.
printStudentsResults
();
}
}
This diff is collapsed.
Click to expand it.
tp1/TeachingUnitResult.java
+
2
−
0
View file @
2961496e
...
...
@@ -26,6 +26,8 @@ public class TeachingUnitResult {
* @return the grade associated to the result
*/
public
Grade
getGrade
()
{
grade
=
teachingUnitName
+
grade
;
return
grade
;
}
/**
...
...
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