-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent2.java
More file actions
47 lines (37 loc) ยท 992 Bytes
/
Student2.java
File metadata and controls
47 lines (37 loc) ยท 992 Bytes
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
package chap05;
public class Student2 {
int studentID;
String studentName;
// int koreaScore;
// int mathScore;
// String koreaSubject;
// String matchSubject;
Subject korea;
Subject math;
public Student2() {
korea = new Subject();
math = new Subject();
}
public Student2(int id, String name) {
studentID = id;
studentName = name;
korea = new Subject();
math = new Subject();
}
public void setKorea(String name, int score) {
korea.setSubjectName((name));
korea.setScore((score));
korea.subjectName = name;
korea.score = score;
}
public void setMath(String name, int score) {
math.setSubjectName((name));
math.setScore((score));
math.subjectName = name;
math.score = score;
}
public void showStudentInfo() {
int total = korea.getScore() + math.getScore();
System.out.println(total);
}
}