Question
C++ Define a Person class with the following class variables string name and address. For methods it should have a default constructor that sets both
C++
Define a Person class with the following class variables string name and address. For methods it should have a default constructor that sets both variables to the empty string. It should have an overloaded constructor that takes parameters for all variables. Each variable should have a setter and a getter. There should be a method getJob that is hard coded to return the string undefined. Define a class Instructor that is a Person. It should add the variable Office hours (a string) with setter and getter. It has a method getJob that is hard coded to return the string instructor. Define a class Student that is a Person. It should add the variable GPA which is a float along with setter and getter. It has a method getJob that is hard coded to return the string student. Use the test program in main to test your class
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