forked from ComputerScienceGroupWork/JavaParsingAssignment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrade.java
46 lines (43 loc) · 1.34 KB
/
Grade.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.util.ArrayList;
public class Grade {
private Student student;
private String course;
private ArrayList<Double> quizzes, tests, assignments, projects;
private double finalExam;
public Grade(Student student, String course, ArrayList<Double> quizzes,ArrayList<Double> tests,
ArrayList<Double> assignments,ArrayList<Double> projects,double finalExam)
{
this.student = student;
this.course = course;
this.quizzes = quizzes;
this.tests = tests;
this.assignments = assignments;
this.projects =projects;
this.finalExam = finalExam;
}
//Overing the to string method [The intention is so that is can be used in the print grade]
public String toString()
{
String s = "";
s += "| " + student.name + " | " + student.computerNumber;
s += " | ";
for (Double x : quizzes) {
s += " Quizzes: " + x +",";
}
s += " | ";
for (Double x : assignments) {
s += " Assignments: " + x +",";
}
s += " | ";
for (Double x : tests) {
s += " Tests:" + x +",";
}
s += " | ";
for (Double x : projects) {
s += " Projects:" + x +",";
}
s += " | Final Exams";
s += finalExam;
return s;
}
}