Question: A college department needs a system for obtaining total hours for all the people involved in its program. They have a record of all

A college department needs a system for obtaining total hours for all the people involved in its program. Write a program using abstract classes to represent people and a proper class hierarchy to represent

A college department needs a system for obtaining total hours for all the people involved in its program. They have a record of all the professors, teaching assistants and students with the name of the course and total hours for each course as follows: Professor Professor Student Student Student Student Professor Student Professor Student Student end Isaac Newton Marie Curie Isaac Newton Amy Adams Will Smith Brad Pitt Will Smith Dmitri Mendeleev Carl Gauss Amy Adams Adam Smith Marie Curie Brad Pitt Will Smith 6 Physics Physics 6 Calculus 4 Calculus 4 Calculus 4 Physics 6 6 Physics Chemistry 6 Calculus 4 Economics 3 Economics 3 Chemistry 6 Chemistry Chemistry 6 6 Out of all hours for each course, the professor attends only lecture hours, TA conducts lab hours and students must attend all hours. The number of lab and lecture hours is based on the total hours of the course: if total hours > 4 then lab hours = 2, otherwise lab hours = 1 lecture hours = total hours- lab hours. Therefore for the following scenario: Professor Isaac Newton Marie Curie Student Brad Pitt Physics 6 Physics 6 Physics 6 the professor has 4 hours, TA has 2, and the student has all 6. Write a program using abstract classes to represent people and a proper class hierarchy to represent professors, TAs and students. Introduce an interface named ParticipateHours that defines the following method: int getParticipating Hours(int courseHours). Abstract class Person must implement this interface. The program should scan the full record above all at once (do NOT prompt the user to enter each line separately) and produce a printout of all the people with their total hours through the use of polymorphism. Every person must be mentioned in the printout only once. The printout should be of the following format: Title (Professor/TA/Student) FirstName LastName TotalHours Do not use ArrayList.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!