Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A college department needs a system for obtaining total hours for all the peopleinvolved in its program. They have a record of all the professors,
A college department needs a system for obtaining total hours for all the peopleinvolved in its program. They have a record of all the professors, teaching assistantsand students with the name of the course and total hours for each course following thispattern:Professor Isaac Newton Physics TA Marie Curie Physics Professor Isaac Newton Calculus Student Amy Adams Calculus Student Will Smith Calculus Student Brad Pitt Physics Student Will Smith Physics Professor Dmitri Mendeleev Chemistry TA Carl Gauss Calculus Student Amy Adams Economics Professor Adam Smith Economics TA Marie Curie Chemistry Student Brad Pitt Chemistry Student Will Smith Chemistry endOut of all hours for each course, the professor attends only lecture hours, TA conductslab hours and students must attend all hours.The number of lab and lecture hours is based on the total hours of the course:if course hours then lab hours otherwise lab hours lecture hours course hours lab hours.Therefore, in the following scenario:Professor Isaac Newton Physics TA Marie Curie Physics Student Brad Pitt Physics the professor has hours, TA has and the student has all
Write a program using abstract classes to represent people and a proper classhierarchy to represent professors, TAs and students. The program should scan the fullrecord above from standard input all at once do NOT prompt the user to enter eachline or data piece separately and do not hard code the record and produce a printout ofall the people with their total hours through the use of polymorphism. Every person mustbe mentioned in the printout only once. The printout should be of the following format:Title ProfessorTAStudent FirstName LastName TotalHoursDo not use ArrayList or any other Java Collections class.Note, there are tabs in the record above, make sure to use regular expression s insplit method or as a delimiter in Scanner object:String tokens line.splites;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started