Explore BrainMass
Share

Java code - college members classes

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Im studying for my finals in Java programming 1.
Im struggling with the attached practice question. I need to write a code for this example.
Can you please ENSURE you add COMMENTS to the code so I can understand how it works. AND also following exactly the instructions in the attachment PLEASE.

The File name is task2 and NOT task1

-

Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include following:

- Person: A Person contains a first name, last name, street address, zip code, and phone number. The class also includes a method that sets each data field and display method that displays all of a Person's information.
- CollegeEmployee: CollegeEmployee descends from Person. A CollegeEmployee also includes a Social Security number, an annual salary, and a department name, as well as methods that override the Person methods to accept and display all collegeEmployee data.
- Faculty: Faculty descends from ColegeEmployee. This class also includes a Boolean field that indicates whether the Faculty member is permanent, as well as methods that override the CollegeEmployee methods to accept and display this additional piece of information.
- Student: Student descends from Person. In addition to the fields available in Person, a Student contains a major field of study and a grade point average as well as methods that override the Person methods to accept and display these additional facts.

Write a test Java program named CollegeList that declares an array of four "regular" CollegeEmployees, three Faculty, and seven Students. Prompt the user to specify which type of person's data will be entered ('C', 'F', or 'S' indicates CollegeEmployee, Faculty, and Student respectively) or allow the user to quit ('Q'). While the user choose to continue (that is, does not quit), accept data entry for the appropriate type of Person. If the user attempts to enter data for more than four CollegeEmployees, three Faculty, or seven Students, display an error message. When the user quits, display a report on the screen listing each group of Persons under the appropriate heading "College Employees," "Faculty," or "Students." If the user has not entered data for one or more types of Persons during a session, display an appropriate message under the appropriate heading.

Save the files as Person.java, CollegeEmployee.java, Faculty.java, and Student.java, and CollegeList.java.

© BrainMass Inc. brainmass.com October 25, 2018, 8:27 am ad1c9bdddf
https://brainmass.com/computer-science/java/java-code-college-members-classes-540714

Solution Summary

A Java program is written which contains classes which descend from other classes. Finally main method invoke a few objects of these classes as per requirements.

$2.19
See Also This Related BrainMass Solution

Creating a C++ Program: Object Oriented Example

Hello I would like to have this written in the C++ language.
Below is detailed information. please send back as cpp files only.

Develop a class named Course to represent a course offered at a college.
Also develop a driver program to (1) read a list of courses from the file "courses.txt",
(2) create a Course object to represent each course, and (3) display all courses.
At the minimum the Course must have two attributes: course type and course title.

Please see attached files for more.

View Full Posting Details