-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise.java
More file actions
26 lines (18 loc) · 927 Bytes
/
Exercise.java
File metadata and controls
26 lines (18 loc) · 927 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
public class Exercise extends Discipline {
public Exercise(String title, double currentGrade, double maxGrade) {
super(title, currentGrade, maxGrade);
}
public Exercise(String title, double currentGrade) {
super(title, currentGrade);
}
public void UpdateCurrentGrade(double currentGrade) {
this.currentOnlineLessonsGrade = currentGrade;
}
protected Exercise clone() {
return new Exercise(this.getTitle(), this.currentOnlineLessonsGrade, this.maxOnlineLessonsGrade);
}
@Override
public String toString() {
return new String(" " + getTitle() + ":" + "\n" + " " + "Текущая оценка: " + String.valueOf(getCurrentOnlineLessonsGrade()) + (getMaxOnlineLessonsGrade() != Double.POSITIVE_INFINITY ? " / " + String.valueOf(getMaxOnlineLessonsGrade()) : ""));
}
}