Week2: Assignment instructions See attached instructions. Thank you

CMSC 215 Intermediate Programming

Programming Project 2

The second programming project involves writing a program that produces a list of students who

are eligible for membership in an honor society. This program consists of four classes.

The java program must contain a main () method. Standard programming practice locates the

main () method at the end of the program. The program class must be the same name as the java

file name.

The first class is the student class. It has three instance variables which include the student

name, credit hours earned and quality points. At a minimum, it should have following methods:

A constructor that allows the student’s name, credit hours and quality points to be

initialized.

A method named gpa that returns the student’s grade point average, which is

computed as the quotient of the quality points and credit hours.

A method eligibleForHonorSociety that returns whether a student’s gpa exceeds the

threshold for honor society membership, which applies to all students.

A toString method that returns a string containing the student’s name and grade point

average

A class (static) method setGpaThreshold that sets the minimum gpa threshold for

honor society membership.

The student class has two subclasses.

The first is Undergraduate. It has an additional instance variable that specifies the student’s

year: either a freshman, sophomore, junior or senior. At a minimum, it should have followed

methods:

A constructor that allows the student’s name, credit hours, quality points and year to

be initialized.

An overridden method eligibleForHonorSociety that applies the requirement that the

student be either a junior or senior in addition to the requirement that applies to all

students to be eligible for honor society membership.

An overridden toString method that returns a string containing the student’s name,

grade point average, and year.

The second subclass is Graduate. It has an additional instance variable that reflects whether

the student is pursuing a master’s degree or doctorate at a minimum, it should have following

methods:

A constructor that allows the student’s name, credit hours, quality points and degree

sought to be initialized.

An overridden method eligibleForHonorSociety that applies the requirement that the

student be seeking a master’s degree in addition to the requirement that applies to all

students to be eligible for honor society membership.

An overridden toString method that returns a string containing the student’s name,

grade point average, and degree sought.

Finally, there should be a fourth class DataControl.. It should read in student information from a

text file named students.txt. If the file does not exist, an error message is displayed, and the

program should terminate. Each line of the text file will represent the information for one

student. An example of how the text file should look is shown below:

Brown, William 72 230 Junior [name, credit hours, quality points, year]

Johnson, Mary 21 77 Masters [name, credit hours, quality points, degree sought]

Jones, Sally 32 95 Sophomore [name, credit hours, quality points, year]

For undergraduate students, the final value is the student’s year. For graduate students, the final

value is the degree the student is seeking. As the students are read in, Student objects of the

appropriate type are created, and they are stored in an array list of type Student. As the students

are read in, the total of all grade point averages should be accumulated so that an average gpa

can be computed. You may assume that the file that the data in the file will be formatted

correctly. [The students.txt data file is generated by the programmer.]

Once all the student data is read in, the threshold for honor society membership should then be

set to the midpoint of the average gpa and the highest possible gpa of 4.0 by calling the

setGpaThreshold method. The threshold should also be displayed on the console. Then a report

should be displayed on the console that lists all students who are eligible for membership.

The program name should be CMSC215PROJ2{last name][initial].

Be sure to follow good programming practice, which means making all instance variables

private, naming all constants, and avoiding the duplication of code. Furthermore, you must select

enough test data to completely test the program.

OUTPUT

The output to the screen should contain the following elements:

1. The threshold gpa for membership in the Honor Society.

2. A line explaining the following student entries.

3. A set of indented lines with all undergraduate and graduate students meeting the

threshold. Each line should have a label of the GPA and either Year or Degree.

4. [Optional] There could be a line or lines prior to the threshold explaining the purpose of

the program.

It is preferable to have a limit number of numbers after the decimal, therefore, formatting would

be user-friendly. The following is one link that could be referenced for formatting. Round a

number to 2 decimal places in Java - MergeTag : MergeTag

Deliverables

You are to submit three files.

1. The first file is a single java program file that contains all the source code for the project.

The java file should contain only source code with appropriate comments and nothing

else. If you elect to use a package, the .java file should be in a folder whose name is the

package name. The program file should include a comment block at the top containing

your name, the project name, the date submitted, and a short description of the class

contained in that file.

The java file and the program name in the java file should use the naming convention of

CMSC215PROJ2[Last Name] [First Initial].java.

2. The second file is a Word document (PDF is also acceptable) that contains the

documentation for the project, which should include the following:

a. A UML class diagram that includes all classes you wrote. Do not include

predefined classes.

b. A test plan that includes test cases that you have created indicating what aspects

of the program each one is testing.

c. A short paragraph(s) on lessons learned from the project.

d. Each of the above elements will be tagged and the content inserted into that

element. As in

UML Diagrams

[Insert the various UML diagrams here.] Test

Plan

[Insert the various test Plan tables here.] Lessons

Learned

[Insert the paragraph(s) that identified the various lessons learned in

research. deign, coding, and documentation.]

e. The documentation name should use the naming convention of

CMSC215PROJ2[Last Name] [First Initial].docx. A .pdf is also optional.

3. A third file, the data file, named students.txt. This data file contains data of at least six

students with varying credit hours, gpas and year/degree with at least one undergraduate

and graduate student identified as meeting the threshold for Honor Society. The file

contains the following fields: full name, credit hours, quality points and degree sought or

undergraduate year.