Question: Description: Write a class named Person that has the following members: name: A string that holds the persons name. phone: A string that holds the

Description: Write a class named Person that has the following members: name: A string that holds the persons name. phone: A string that holds the person's phone number. The class should include at least 1 default constructor, setters, getters, and printInfo methods. Write another class named Professor that inherits from the Person class and has the following members: salary: A double that holds the professor's salary. The class should include at least 1 default constructor, setters, getters, and printInfo methods. Write another class named Student that inherits from the Person class and has the following members: tuition: A double that holds the student's tuition. The class should include at least 1 default constructor, setters, getters, and printInfo methods. In the main class, the program should ask the user to enter the information of one professor and one student and store the data in objects and then display the data for each individual on the screen.

Step by Step Solution

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 Databases Questions!