Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ (1)Create three classes Human, Parent and Child with the following member variables and member function HUMAN Member Variables: Private: string name Private: int age

C++

(1)Create three classes Human, Parent and Child with the following member variables and member function

HUMAN

Member Variables:

Private: string name

Private: int age

Private: char sex

Member Functions:

Private: default constructor

Protected: constructor with three arguments

Public: All setters and getters

Public: virtual work()

Parent

inherit class Human

Additional Member Variables:

Private vector children Should be able to assign children as they are created

Additional Member Function:

Setter/Getter for children

Child

inherit class Human

Additional Member Variables:

Private: Parent Mom

Private: Parent Dad

Additional Member Function:

Private: default constructor

Public: constructor will have 2 input parent arguments for Mom and Dad

Additionally, Parents should be able to change Childs name

HINT: How can we change private variables in another class??

DATA:

Name

Homer

March

Lisa

Bart

Maggie

Age

36

34

12

10

3

Sex

M

F

F

M

F

Work

Safety inspector

Housewife

Students

Student

Play

(2)In Main (1)Create the Simpson family

(2) have Mach Set Maggies name

(3) Have Homer set Bart and Lisas name

(4) print out Homer, Lisa, and Maggies names, age, sex and work

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

years ago. d Only using studies which feature empirical data.

Answered: 1 week ago