***I need help with what code to put in FirstName_LastName class and the MyCourse class***
[1] Description: You’re asked to create a basic Student’s Enrollment System with the provided Student and Course classes. Please download the source code files from Blackboard. Create two new classes: (i) FirstName_LastName (replace by your name) that extends the Student class and (ii) MyCourse that extends the Course class.
[2] Requirements: a. You’re NOT allowed to change or add ANYTHING in the provided Student and Course classes.
b. Provide a no-arg constructor for your FirstName_LastName class. The no-arg constructor should initialize all the data fields in Student class based on your information and your current semester’s enrolled courses.
c. Override 6 methods in Student class, as marked in the source code comments. Please read the comment sections carefully for descriptions.
d. Override the equals() method in MyCourse class. Two courses are equal if they have the same course number, course name, and credit hours. You should use this method for all courses comparisons.
e. Create a customized exception class CourseNotFoundException, throw this exception in the dropCourse() method if the dropping course doesn’t exist in the courseList. The thrown exception object should contain a meaningful message, including course number, course name, and credit hours for the not found course.
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;
}
}
Step by stepSolved in 2 steps
- //please don't copy from chegg In java : Create an application that can use the name to search for a friend's email and phone number. The following programmer-defined classes should be included in the application: FriendInfo – class stores friend records including name, email address and phone number and necessary methods. MySohu – class creates a collection; carry out adding, deleting, searching, sorting, and printing operations. You may use any Collection class including Map discussed in the textbook. These operations must be displayed and processed as a menu using JOptionPane or any GUI components. Don’t use System. in for input and System. out for output. RegexValidat or – Verify all data entries from the user. You will prompt a format of name (Xxxx, Xxxx where x is any letters and X is a capital letter), format of email (xxxx.xxx@xxxx.xxx where x is any letters or numbers), and format of mailing address (### Xxx Xxx, Xxxx, XX ##### where # is any number and x is any letters and…arrow_forwardcreateDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles. 2. Reads the profiles from the input file. 3. For each person in the file 1. creates a Profile object with the information from file (see input file format below). 2. insert the newly created profile into the next position in the database array (instance variable).arrow_forwardNEED HELP DEBUGGING THE FOLLOW JS CODE JS CODE /* JavaScript 7th Edition Chapter 3 Project 03-05 Application to generate a horizontal bar chart Author: Date: Filename: project03-05.js*/ // Array of phone models sold by the companylet phones = ("Photon 6E", "Photon 6X", "Photon 7E", "Photon 7X", "Photon 8P"); // Units sold in the previous quarterlet sales = (10281, 12255, 25718, 21403, 16142); // Variable to calculate total saleslet totalSales = 0; // Use the forEach() method to sum the sales for each phone model and add it to the totalSales variablesales.forEach(addtoTotal); // For loop to generate bar chart of phone salesfor (let i = 1; i <= phones.length; i++) { let barChart = ""; // Variable to store HTML code for table cells used to create bar chart // Calculate the percent of total sales for a particular phone model let barPercent = 100*sales/totalSales; let cellTag; // Variable that will define the class of td…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY