Java Programming Please do not change anything in Student class or Course class class John_Smith extends Student{ public John_Smith() { setFirstName("John"); setLastName("Smith"); setEmail("jsmith@jaguar.tamu.edu"); setGender("Male"); setPhoneNumber("(200)00-0000"); setJNumber("J0101459"); } class MyCourse extends Course { public MyCourse { class Course { private String courseNumber; private String courseName; private int creditHrs; public Course (String number, String name, int creditHrs){ this.courseNumber = number; this.courseName = name; this.creditHrs = creditHrs; } public String getNumber() { return courseNumber; } public String getName() { return courseName; } public int getCreditHrs() { return creditHrs; } public void setCourseNumber(String courseNumber) { this.courseNumber = courseNumber; } public void setCourseName(String courseName) { this.courseName = courseName; } public void setCreditHrs(int creditHrs) { this.creditHrs = creditHrs; } } class Student { private String firstName; private String lastName; private String gender; private String phoneNumber; private String email; private String jNumber; protected ArrayList courseList; public String getFullName() { return firstName + " " + lastName; } public void setFirstName(String fName) { firstName = fName; } public void setLastName(String lName) { lastName = lName; } public String getGender() { return gender; } public void setGender(String gen) { gender = gen; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String pNumber) { phoneNumber = pNumber; } public String getEmail() { return email; } public void setEmail(String e_mail) { email = e_mail; } public String getJNumber() { return jNumber; } public void setJNumber(String jNum) { jNumber = jNum; } /* OVERRIDE! Print student's basic information following the format in the assignment's description*/ public void printBasicInfo() { } /* OVERRIDE! Print all courses following the format in the assignment's description */ public void printCourseList() { } /* OVERRIDE! Enroll a new course by adding it into the courseList Do NOT add a course if it is already in the courseList */ public void addCourse(MyCourse course) { } /* OVERRIDE! If the course exists, remove it from the courseList throw CourseNotFoundException if it doesn't exist*/ public void dropCourse(MyCourse course) { } /* OVERRIDE! Return true if the course is currently enrolled, otherwise, false */ public boolean isEnrolled(MyCourse course) { return false; } /* OVERRIDE! Return total credit hours for all enrolled courses */ public int getTotalCredits() { return 0; } }
Java Programming
Please do not change anything in Student class or Course class
class John_Smith extends Student{
public John_Smith() {
setFirstName("John");
setLastName("Smith");
setEmail("jsmith@jaguar.tamu.edu");
setGender("Male");
setPhoneNumber("(200)00-0000");
setJNumber("J0101459");
}
class MyCourse extends Course {
public MyCourse {
class Course {
private String courseNumber;
private String courseName;
private int creditHrs;
public Course (String number, String name, int creditHrs){
this.courseNumber = number;
this.courseName = name;
this.creditHrs = creditHrs;
}
public String getNumber() {
return courseNumber;
}
public String getName() {
return courseName;
}
public int getCreditHrs() {
return creditHrs;
}
public void setCourseNumber(String courseNumber) {
this.courseNumber = courseNumber;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public void setCreditHrs(int creditHrs) {
this.creditHrs = creditHrs;
}
}
class Student {
private String firstName;
private String lastName;
private String gender;
private String phoneNumber;
private String email;
private String jNumber;
protected ArrayList<MyCourse> courseList;
public String getFullName() {
return firstName + " " + lastName;
}
public void setFirstName(String fName) {
firstName = fName;
}
public void setLastName(String lName) {
lastName = lName;
}
public String getGender() {
return gender;
}
public void setGender(String gen) {
gender = gen;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String pNumber) {
phoneNumber = pNumber;
}
public String getEmail() {
return email;
}
public void setEmail(String e_mail) {
email = e_mail;
}
public String getJNumber() {
return jNumber;
}
public void setJNumber(String jNum) {
jNumber = jNum;
}
/* OVERRIDE!
Print student's basic information following the format in the assignment's description*/
public void printBasicInfo() {
}
/* OVERRIDE!
Print all courses following the format in the assignment's description */
public void printCourseList() {
}
/* OVERRIDE!
Enroll a new course by adding it into the courseList
Do NOT add a course if it is already in the courseList */
public void addCourse(MyCourse course) {
}
/* OVERRIDE!
If the course exists, remove it from the courseList
throw CourseNotFoundException if it doesn't exist*/
public void dropCourse(MyCourse course) {
}
/* OVERRIDE!
Return true if the course is currently enrolled, otherwise, false */
public boolean isEnrolled(MyCourse course) {
return false;
}
/* OVERRIDE!
Return total credit hours for all enrolled courses */
public int getTotalCredits() {
return 0;
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps