-
Notifications
You must be signed in to change notification settings - Fork 2
/
reportCard.java
114 lines (109 loc) · 2.85 KB
/
reportCard.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Report Card class
*
*/
public class reportCard {
private char mSection;
private String mName;
private int mClass;
private int mGeography;
private int mHistory;
private int mPhysics;
private int mChemistry;
private int mComputerScience;
private int sum;
public reportCard(String name, int class_, char section, int history, int geography,
int physics, int chemistry, int computerScience) {
mName = name;
mClass = class_;
mSection = section;
mHistory = history;
mGeography = geography;
mPhysics = physics;
mChemistry = chemistry;
mComputerScience = computerScience;
}
// Get name of Student
public String getName() {
return mName;
}
// Set Name of Student
public void setName(String name) {
mName = name;
}
// Get class of student
public int getClass_() {
return mClass;
}
// Set class of student
public void setClass(int class_) {
mClass = class_;
}
// Get section of student
public char getSection() {
return mSection;
}
// Set section of student
public void setSection(char section) {
mSection = section;
}
// Get history marks
public int getHistoryMarks() {
return mHistory;
}
// Set history marks
public void setHistoryMarks(int history) {
mHistory = history;
}
// Get geography marks
public int getGeographyMarks() {
return mGeography;
}
// Set geography marks
public void setGeographyMarks(int geography) {
mGeography = geography;
}
// Get physics marks
public int getPhysicsMarks() {
return mPhysics;
}
// Set physics marks
public void setPhysicsMarks(int physics) {
mPhysics = physics;
}
// Get chemistry marks
public int getChemistryMarks() {
return mChemistry;
}
// Set chemistry marks
public void setChemistryMarks(int chemistry) {
mChemistry = chemistry;
}
// Get CS marks
public int getComputerScienceMarks() {
return mComputerScience;
}
// Set CS marks
public void setComputerScienceMarks(int computerScience) {
mComputerScience = computerScience;
}
// get total marks
public int getTotalMarks() {
sum = mGeography + mChemistry + mPhysics + mComputerScience +
mHistory;
return sum;
}
public double getPercentage() {
return (sum/5);
}
@Override
public String toString() {
return "Result { " +
"History = " + mHistory +
", Geography = " + mGeography +
", Computer Science = " + mComputerScience +
", Chemistry = " + mChemistry +
", Physics = " + mPhysics +
" }";
}
}