Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C + + code. Why does my output not display the name, phone number, and email address? How can I fix it ? College student
C code. Why does my output not display the name, phone number, and email address? How can I fix it College student is supposed to be subclass of Individual, Personell subclass of Individual, Faculty subclass of Personell, and Staff subclass of Personell. Do not make job position and title the same.
#include
#include
using namespace std;
class Individual
public:
Individual;
Individualstring Name, string PhoneNumb, string EmAddress;
virtual void tostring const;
private:
string name;
string phoneNumb;
string emAddress;
;
Individual::Individual
Individual::Individualstring Name, string PhoneNumb, string EmAddress
string name Name;
string phoneNumb PhoneNumb;
string emAddress EmAddress;
void Individual::tostring const
cout Individual named: name PhoneNumb: phoneNumb email Address: emAddress;
CollegeStudent class and functions
class CollegeStudent : public Individual
public:
CollegeStudent;
CollegeStudentstring Year, string Name, string PhoneNumb, string EmAddress;
virtual void tostring const override;
private:
string year;
;
CollegeStudent::CollegeStudent
CollegeStudent::CollegeStudentstring Year, string Name, string PhoneNumb, string EmAddress : IndividualName PhoneNumb, EmAddress
year Year;
void CollegeStudent::tostring const
Individual::tostring;
cout year type: year;
Personnell class and functions
class Personnell : public Individual
public:
Personnell;
Personnellint Income, string Name, string PhoneNumb, string EmAddress;
virtual void tostring const override;
private:
int income ;
adds a Income
;
Personnell::Personnell
Personnell::Personnellint Income, string Name, string PhoneNumb, string EmAddress : IndividualName PhoneNumb, EmAddress
income Income;
void Personnell::tostring const
Individual::tostring;
cout income: income;
Faculty class and functions
class Faculty : public Personnell
public:
Faculty;
Facultystring Title, int Income, string Name, string PhoneNumb, string EmAddress;
virtual void tostring const override;
private:
string title; subclasses Personnell, adds a title
;
Faculty::Faculty
Faculty::Facultystring Title, int Income, string Name, string PhoneNumb, string EmAddress : PersonnellIncome Name, PhoneNumb, EmAddress
title Title;
void Faculty::tostring const
Personnell::tostring;
cout title: title endl;
Staff class and functions
class Staff : public Personnell
public:
Staff;
Staffstring JobPosition, int Income, string Name, string PhoneNumb, string EmAddress;
virtual void tostring const override; subclasses Personnell and adds a JobPosition
private:
string jobPosition;
;
Staff::Staff
Staff::Staffstring JobPosition, int Income, string Name, string PhoneNumb, string EmAddress : PersonnellIncome Name, PhoneNumb, EmAddress
jobPosition JobPosition;
void Staff::tostring const
Personnell::tostring;
cout position: jobPosition endl;
int main
Individual individual;
individual new IndividualNancy "nancy@imail.com";
individualtostring;
cout endl;
individual new CollegeStudentSophmore year", "Jessica", "jessicajess@uni.edu";
individualtostring;
cout endl;
individual new Personnell "Alfred", "alfredal@work.com";
individualtostring;
cout endl;
individual new FacultyTeacher "David", "david@teacher.edu";
individualtostring;
cout endl;
individual new StaffCustodian "Sam", "sam@custodian.edu";
individualtostring;
Individual named: PhoneNumb: email Address:
Individual named: PhoneNumb: email Address: year type: Sophmore year
Individual named: PhoneNumb: email Address: income:
Individual named: PhoneNumb: email Address: income: title: Teacher
Individual named: PhoneNumb: email Address: income: position: Custodian
::UsersdcbraDocumentsCSC Assignments CodesCodingquestionsxDebugCodingquestionsexe process exited
ith code
To automatically close the console when debugging stops, enable ToolsOptionsDebuggingAutomatically close the conso
e when debugging stops.
ress any key to close this window
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