For this
Modify the program in Listing 8.6 to include at least one Faculty object and at least one Staff object in addition to the Undergraduate and Student objects. Without modification to the for loop, the report should output the name, employee ID, department, and title for the Faculty objects, and the name, employee ID, department, and pay grade for the Staff objects.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Mechanics of Materials (10th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Elementary Surveying: An Introduction To Geomatics (15th Edition)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out With Visual Basic (8th Edition)
- Write a class named Person with data attributes for a person’s name, address, and telephone number. Next, write a class named Customer that is a subclass of the Person class. The Customer class should have a data attribute for a customer number and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Demonstratean instance of the Customer class in a simple program.arrow_forward1. Create a Student class that implements the Person interface. As well as storing the students name and email, also store their course grade (e.g A, B, C) in a member variable. The grade should be accessible via a getGrade method. For the implementation of getDescription return a message along the lines of “A C grade student”, substituting the students actual grade.2. Create a Lecturer class that implements the Person interface. This class should also store the subject that the lecturer teaches. Add a getSubject method, and implement getDescription so that it returns a suitable message, e.g. “Teaches Biology”.3. Create a third class, Employee that implements the interface. This should also store the name of the department the Employee works in (available via getDepartment). Again, getDescription should return a suitable message.arrow_forwardThe Doctor program described in Chapter 5 combines the data model of a doctor and the operations for handling user interaction. Restructure this program according to the model/view pattern so that these areas of responsibility are assigned to separate sets of classes. The program should include a Doctor class with an interface that allows one to obtain a greeting, a signoff message, and a reply to a patient’s string. To implement the greeting, define a method named greeting for the Doctor class. To implement the signoff message, define a method named farewell for the Doctor class. Both greeting and farewell should return a string with a greeting or farewell message respectively. The reply function is defined for you, it should be added as a method for the Doctor class. The rest of the program, in a separate main program module, handles the user’s interactions with the Doctor object. Develop this program with a terminal-based user interface. Note: The program should output in the…arrow_forward
- Design and implement java program for " Covenant System"; the system stores a covenant name, type and date for each object. Also, each Covenant should have the employee name and ID. The system contains a Covenant class and TestCovenant class. To implement the class, you must: (not exclusively)Make at least one constructor to initialize the object with a Date object and ID.Each private data must have setter and getter method.In the main class you have to create 5 Covenants objects and assign for each object its (name, id, datecreated, Employee name, Employee ID). Submit UML class diagramarrow_forwardWe are working in 2D and programming in C#. Create a Point class to represent points in 2D. Create an abstract base class named Shape. It should have a position property as a Point. It should be designed as having Move and Resize methods. Create a Line class using Points, derived from Shape class. Its position should be the center of the line. Create a Polygon class representing a closed polygon of Lines, derived from Shape class. Note that, at construction time, Lines may not be provided in order. The continuity and number of the lines should also be checked for a properly closed Polygon. All geometric entities should be moveable. All shapes should be resizable without changing their central positions. All shapes' positions should be their centroids. Shapes should have areas calculated. Write an example C# Console code to demonstrate your program's abilities.arrow_forwardA C++ assignment Implement the GradedActivity class. Copying from the pdfs is fine. Create a new class Assignment which is derived from GradedActivity. It should have three private member ints for 3 different parts of an assignment score: functionality (max 50 points), efficiency (max 25 points), and style (max 25 points). Create member function set() in Assignment which takes three parameter ints and sets the member variables. It should also set its score member, which is inherited from GradedActivity, using the setScore() function, to functionality + efficiency + style. Signature: void Assignment::set(int, int, int) Create a main program which instantiates an Assignment, asks the user for its functionality, efficiency, and style scores, and prints out the score and letter grade for the assignment. ___________________________________________________ Examples from the pdfs: d PassFailExam::set(int q, int m, int p) { double numericScore, pointsEach; numQuestions =…arrow_forward
- T/F1. However, implementation classes may be extended, but interface classes cannot.arrow_forwardImplement the following parking permit class using java It has a dependency on the car class, no need to implement the car class. Use the diagram for refrencearrow_forwardThis programming problem consists of two parts and shall lead you through all the concepts involved in OOP Composition. Part 1: A class called Author (as shown in the class diagram) is designed to model a book's author. It contains: Three private instance variables: name (String), email (String), and gender (char of either 'm' or 'f'); One constructor to initialize the name, email and gender with the given values;public Author (String name, String email, char gender) {......}(There is no default constructor for Author, as there are no defaults for name, email, and gender.) public getters/setters: getName(), getEmail(), setEmail(), and getGender();(There are no setters for name and gender, as these attributes cannot be changed.) A toString() method that returns "Author[name=?,email=?,gender=?]", e.g., "Author[name=Tan Ah Teck,email=ahTeck@somewhere.com,gender=m]". Write the Author class. Also, write a test driver (for testing purpose on your local machine) called TestAuthor to test…arrow_forward
- Convert the UML class diagram above into a java code with the following conditions The methods in the Pet class are abstract. Create a class called test. The main() method in the test class should create three Cat objects and two Budgie The main() method should also create indirectly an object of the Pet class. Demonstrate polymorphism in your testarrow_forwardAn unspecified data type can be used for both the parameters and the return type just for abstract classes (because they can not be instantiated) just for the signature of a method (i.e., the parameters) O just for the non-signature parts of the method (i.e., the return type)arrow_forwardFor this Programming Employee class should haveinstance variables to store the employee ID as an int and the employee’s department as a String.The Faculty class should have an instance variable to store the faculty member’s title (e.g., “Professor ofComputer Science”) as a String. The Staff class should have an instance variable to store the staffmember’s pay grade (a number from 1 to 20) as an int. Every class should have appropriateconstructors, accessors, and mutators, along with a writeOutput method that outputs all of the instancevariable values Note: code javaarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education