Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

EECS 2030: Programming Exam 2

Fall 2022

In this programming exam, we are going to assess your understanding of:

Objects relationships (such as inheritance, composition, and aggregation).

The difference between interfaces, abstract classes, and classes.

Polymorphism

Exception handling

Encapsulation

Java documentation API and the ability to create JavaDoc

Setting up the environment:

Download the attached zip file.

Open eclipse.

Click on File and select Import

Choose Existing Projects into Workspace and click Next

Click on Select Archive File and then Browse.

Find the zip file that you have already downloaded and click Finish

Please make sure that you do not already have a project called EECS2030_Fall22_PE2

Now you should see the following settings in the package explorer.

Before you start, I would like to remind you that this assignment is different from the labs you have done until now, as this assignment is an exam that you take home, which means you can neither discuss your solution with peers nor get help from them. Therefore, you need to carefully read the statement at the top of CSD.javabefore starting the programming test2 (PE2). When you finish solving PE2, you need to sign this statement by writing your information (full name and student number and section) in the gap provided. Please be aware that your PE2 solution WILL NOT be marked if you do not sign the declaration statement. Also, I would like to inform you that your code will be checked by both a plagiarism detection tool and us to make sure your solution to this PE2 is unique and not similar to others.

Refusing to follow the policy stated above is a violation of academic integrity that will have serious consequences. Please read about the definition of academic integrity and the penalty you may face if you violate academic integrity https://lassonde.yorku.ca/student-life/academic-support/academic-honesty- integrity.

Important Reminders

•   You can submit your PE2 work in eClass any time before 23:59 on Tuesday (December 6, 2022). Your last submission will overwrite the previous ones, and only the last submission will be graded.

•   The deadline is strict with no excuses: you receive 0 for not making your electronic submission on time. Emailing your solutions to the instructors or TAs will not be     accepted.

•   To submit your work, you need to usethe York eClass.

•   Do not copy or look at specific solutions from the net.

•   Academic honesty will be strictly enforced in this course. Specifically, direct                            collaboration (e.g., sharing code or answers) is not permitted, and plagiarism detection        software will be employed. Students are expected to read theSenate Policy on Academic Honesty. See also theEECS Department Academic Honesty Guidelines.

•   Please note that encapsulating data is essential in PE2. Your code will be evaluated on the   correct   implementation   of   encapsulation.   Since  the  testing   is   performed automatically,  improper encapsulation  implementation  might  affect the successful execution of some test cases.

Your code should include Javadoc comments.

•   The PE2 will be graded not only by JUnit tests given to you but also by additional tests covering some other input values. This is to encourage you to take more responsibility for the correctness of your code by writing your tests using custom testers that can      handle the boundary cases and error conditions.

It would be best to run the JUnit tester CSDTest.java after completing all the required classes to check your work. Nonetheless, passing all given tests does not guarantee full marks for this PE2. Therefore, you are required to write additional tests to ensure the correctness of your implementations.

Marking Scheme:

[80 points]: Your code will be tested with test cases. All these 80 points are lost if the code has compilation errors. Hence, it is mandatory that you submit a code that is        compiler errors free.

[20 points]: For inner documentation, Javadoc and proper code style.

Important Note: Since you are provided with test cases, you are not allowed to hard code the methods’ outputs. Any method that has the output hardcoded will get 50% of its mark reduced.

Problem Description:

You are hired to build a software for a new Computer Science (CS) department, or CSD for short. You are required to write an object-oriented program that implements a scenario of CS personnel subsystem. The following UML diagram shows an overview architecture of the department’s personnel. The UML diagram shows the inheritance relationship among the classes. It should be noted here that this UML diagram is not complete .  Hence, you need to read the problem description carefully to determine the attributes and methods for each class. Also, you need to read the JUnit test file CSDTest.java.

Moreover, you need to determine if the class is abstract, or concrete based on the problem description. Therefore, if you look at the startup PE2 project, you will find the package pe2 with CSD.java file, which does not contain any functional code, as you are supposed to read this diagram and implement the code in CSD.java. You must create your classes inside the CSD.java file after reading the problem description.

Remember that you need to follow best OO practices while implementing the solution for the CS department scenario (i.e., object-oriented encapsulation, abstraction, information hiding, ... etc.)

Generalinformation andConfigurationabouttheCS Department:

•   The CSD has as a community, a group of: Academics that can be Administrators, or Faculty members.

•    CSD admits Students to its programs. A Student can be a Graduate or Undergraduate.

•   A Grad student can work in the CSD as a TA with a faculty member.

•   The CSD stores the following information about any TA: First name, Last name, Age, Gender, Student ID, and Address

•   The CSD stores the following information about any academic, faculty or administrator: First Name, Last name, Age, Gender, Employee ID, Address and Salary.

•   The CSD assigns a unique employee ID to each Academic, faculty, or administrator. Employee IDs start at 100.

•   The university stores the following information about admitted students: First Name, Last name, Age, Gender, Student ID and Address.

•   The university assigns a unique Student ID to each student starting from 1000.

•   The university is not allowed to have duplicate student records.

•   An Undergrad Student has a designated Faculty assigned as an academic advisor.

•   A Faculty can have several undergrad Students assigned at the same time.

•   Any Grad student can be assigned to any faculty.

•   There are two types of academic administrator roles: Chairperson and Program Director.

•   There is only one Chairperson for the department. The Chairperson overlooks and manages all the Program Directors.

•   Faculty members belong to one of the following 3 programs: Computer Science, Software Engineering, and Digital Technology.

•   There is one Program Director for each of these programs, and a program director overlooks and manages only faculty members in the same program.

It is essential to know that CSD has the following restrictions:

•   Number of Chairpersons: 1

•   Number of Program Directors: 3

•   Number of Faculty assigned to a Program Director: Up to a maximum of 25

•   Number of Faculty members: Up to a Maximum of 70

•   Number of Grad students: Up to a Maximum of 150

•   Number of Undergrad Students: Up to a Maximum of 500

•   Number of Grad students assigned to a Faculty as TAs: Up to a maximum of 5

•   Number of Undergrad students assigned to a Faculty for advising: Up to a maximum of 8

Task1:

•   Read the problem description and check the Junit test cases to identify all the implicit and explicit entities stated in the scenario and design a suitable class hierarchy for the CSD department. Add appropriate constructors, accessor/getter, mutator/setter          methods to provide basic functionality to the classes. Also, appropriately redefine       equals() and toString() methods while using the class attributes.

Task2:

Implement the following operations relevant to the appropriate classes you have defined.

AdmitStudent: when the department admits a new undergraduate student

a.   You need to add the student information to the department student record

b.   You need to assign a faculty to every newly admitted undergrad student, and then the student will be added to the corresponding faculty record.

c.   The undergrad students are assigned to faculty on a first-come-first-serve basis.

d.   The department should not admit the same student twice (i.e., no duplicate student in the university -student record)

AlumnusUGrad: when a student graduates from the university, you need to  clear/remove the student’s information from the university students’ record.

HireTAs: when the department admits a new graduate student,

a.   you need to store the grad student information in the department grad record and

b.   You need to  assign the grad student as a TA to a faculty who has not exceeded the TAs limit yet.

a.   The department cannot admit the same grad student twice. Hence, there is no duplicate.

b.   The TAs are assigned to faculty on a first-come-first-serve basis.

AlumnusGrad: when a Grad student graduates, you need to clear/remove the student information from the department’s record.

ExtractAllUGradDetails: you need to extract and return all the undergraduate   students information stored in the university students’ record as a sorted list of students according to the student's full name.

a. The student’s full name is defined as a concatenation of first name and last name as follows: if a student's first name is "John" and the last name is     "Smith", the student's full name is "John, Smith".

ExtractAllFacultyDetails: you need to extract and return all the information of faculty  members stored in the university faculty records as a sorted list of faculty according to the faculty’s full name.

a. The faculty’s full name is defined as a concatenation of first name and last name as follows: if a faculty’s first name is "Sara" and the last name is "Adams", the  faculty's full name is "Sara, Adams".

ExtractAllGradDetails: you need to extract and return all the Grad students information stored in the department record as a list of Grad Students.

ExtractAviseesDetails: you need to extract and return all the students information that are advisees of a particular faculty as a sorted list of students according to the student’s full name.

a. The student’s full name is defined as a concatenation of first name and last name as follows: if a student's first name is "John" and the last name is     "Smith", the student's full name is "John, Smith".

ExtractTAsDetails: you need to extract and return all the Grad student information assigned to a particular faculty as a list of TAs.

ExtractFacultyDetails: you need to extract and return all the faculty      information belonging to a particular program as a sorted list of faculty members according to the faculty's full name.

a. The faculty’s full name is defined as a concatenation of first name and last name as follows: if a faculty’s first name is "Sara" and the last name is "Adams", the  faculty's full name is "Sara, Adams".

HireFaculty: when the University hires a new faculty member

a.   You need to add the faculty information to the university faculty records.

b.   The newly hired faculty is assigned to the designated Program Director  according to the specialty of faculty member, and then the hired faculty will be added to the corresponding Program Director’s record