Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 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 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 following 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 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 name, grade point average, and degree sought
Finally there should be a fourth class Project 2 that contains the main method. It should read in student information from a text file named students . txt. If the file does not exist, an error
message should be 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 will look is shown below:
Brown, william 72230 Junior
Johnson, Mary 2177 Masters
Jones, Sally 3295 Sophomore
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 should be created and they should be 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.
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 .
Be sure to follow good programming style, 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.
You are to submit two files.
The first is a . zip file that contains all the source code for the project. The .zip file should contain only source code and nothing else, which means only the . java files. If you elect to use a package, the . java files should be in a folder whose name is the package name. Every outer class should be in a separate . java file with the same name as the class name. Each file should include a comment block at the top containing your name, the project name, the date, and a short description of the class contained in that file.
The second is a Word document (PDF or RTF 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 on lessons learned from the project
image text in transcribed

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 the nature of negative messages.

Answered: 1 week ago