-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreditCourse.java
More file actions
54 lines (44 loc) · 1.17 KB
/
CreditCourse.java
File metadata and controls
54 lines (44 loc) · 1.17 KB
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
import java.util.ArrayList;
public class CreditCourse extends Course
{
/**
* Creating instance variables
*/
private String semester;
public double grade;
public boolean active;
public CreditCourse(String name, String code, String descr, String fmt,String semester, double grade)
{
/**
* Default constructor method, that calls the super() constructor that initializes inherited
* variables from superclass Course
*/
super(name, code, descr, fmt);
this.semester = semester;
this.grade = grade;
active = false;
}
/**
* This setter method method sets the active variable to true
*/
public void setActive()
{
active = true;
}
/**
* This setter method sets the active variable to false
*/
public void setInactive()
{
active = false;
}
/**
* This method returns the superclass's getDescription() method along with the semester and grade
* @return A string representing the course code, course name, course description, course format,
* semester, and the student's grade for this course
*/
public String displayGrade()
{
return getCode() + " " + getName() + " " + semester + " Grade " + convertNumericGrade(grade);
}
}