Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/*Java Methods Implementation - 3 Classes with StudentManagementSystem being the Important one. StudentsInfo & CourseInfo Classes have 1 or 2 methods to implement. First implement

/*Java Methods Implementation - 3 Classes with "StudentManagementSystem" being the Important one. StudentsInfo & CourseInfo Classes have 1 or 2 methods to implement. First implement StudentInfo & Courseinfo classes then implement the "StudentManagementSystem" Class methods. Its Very easy and takes very less time to finish for a professional java coder. Thank you

Here it goes -

Here it goes-

We consider a database that stores information about students and courses. Each student record (e.g., String name, double percentage, int course ID) can be uniquely identified by a String ID (e.g., e1), whereas each course record (e.g., String name and String instructor for course name and instructor name, respectively ) can be uniquely identified by an integer id (e.g., 1030). You must implement all methods in the StudentManagementSystem by manipulating the two attributes students and courses, each of which declared as a HashMap.

/************************* STUDENTINFO CLASS BEGINS HERE ************//

/********************************************** STUDENTINFO CLASS HERE ***************************************// */

public class StudentInfo {

String name;

double percentage;

Integer Id ;

public StudentInfo(String name, double percentage, Integer Id) {

// Implement

}

// Make setters & getters for Name, Percentage and Id

// 2 Methods for this class

/** #1

* Compare this StudentInfo object and other StudentInfo object.

* An StudentInfo 'info1' is "smaller" than another 'info2' if

* info1's percentage is higher than info2's. If both have the

* same percentage, then one with a larger course id is considered

* as "smaller". When being sorted in an increasing order (using Arrays.sort),

* the smaller StudentInfo object appears earlier than the larger one.

*

* @returns Positive value if this is larger than other, negative if this

* is smaller than other, zero otherwise.

*

*/

public int compareTo(StudentInfo other){

// Implement

}

/** #2

* Two StudentInfo objects are equal if their name, percentage, and course id are equal.

*

* @Overrides equals in class java.lang.Object

*

* @returns Whether this StudentInfo object equals 'obj'

*

*/

public boolean equals(Object obj){

// Implement

}

} //************************* STUDENTINFO CLASS ENDS HERE ************//

//********************** COURSEINFO CLASS BEGINS HERE ******************//

//********************** COURSEINFO CLASS BEGINS HERE ******************//

public class CourseInfo {

String name;

String instructor;

public CourseInfo(String name , String instructor){

this.instructor = instructor;

this.name = name;

}

// Make setters & getters for Name, Percentage and Id

/**

* Two Courses objects are equal if their name and instructor are equal.

*

* @Overrides equals in class java.lang.Object

*

* @returns

* Whether the two courses are equal

*/

public boolean equals(Object obj)

{

//Implement

}

} //************************* COURSE INFO CLASS ENDS HERE ************//

// THE VERY IMPORTANT ONE IS HERE

//***************** STUDENTMANAGMENTSYSTEM CLASS BEGINS HERE ***********//

//***************** STUDENTMANAGMENTSYSTEM CLASS BEGINS HERE ***********//

You must implement all methods in the StudentManagementSystem by manipulating the two attributes students and courses, each of which declared as a HashMap. /* All methods must be implemented via courses and students */ }

public class StudentManagementSystem {

HashMap courses ;

HashMap students;

//Constructor

public StudentManagementSystem() {

//Initialize an empty database.

}

// Methods Begins here

/**

* Add a new student entry.

*

* @param id

* id of the student

* @param info

* information object of the student

*/

public void addStudent( String id, StudentInfo info) {

// Implement

}

/**

* Remove an existing student entry.

*

* @param id

* id of the student

*/

public void removeStudent(String id) {

// Implement

}

/**

* Add a new course entry.

*

* @param id

* id of the course

* @param info

* information object of the course

*/

public void addCourse(Integer id, CourseInfo info) {

// Implement

}

/**

* Remove an existing course entry..

*

* @param id

* id of some course

*/

public void removeCourse(Integer id) {

// Implement

}

/**

* Change the course of student with id 'eid' to a new course

* with id 'did'. You can assume that 'did' denotes a course

* different from the current course of the student denoted

* by 'eid'.

*

* @param eid

* id of the student

* @param did

* id of some course

*/

public void changeCourse(String eid, Integer did) {

// Implement

}

/**

* Retrieve the name of student with id 'id'.

*

* @param id

* id of the student

* @return name of the student with id 'id'

*

*/

public String getStudentName(String id) {

// Implement

}

/**

* Retrieve the names of all students of the course

* with id 'id'. If 'id' a non-existing course id,

* then return an empty list..

*

* @param id

* id of some course

* @return List of names of students whose course has id 'id'

*

*/

public ArrayList getStudentNames(Integer id) {

// Implement

}

//************************* STUDENTMANAGMENTSYSTEM CLASS ENDS HERE ************//

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe sleeps functions.

Answered: 1 week ago

Question

3. How has e-commerce transformed marketing?

Answered: 1 week ago