please help me using C++ to create the following hierarchy of classes;
(1). a Person class with fields for name (type String) and an email address (type String). it should contain two constructors: one without input , a second one with input name of type string and email of type string to appropriately set the name and email address' you also need to provide a setName, setEmail and showPerson method.
(2). a OfficePerson class that extends Person. it should inherit the fields from Person well as define one additional field phone of type int to hold a 4-digit phone extension number. Override inherited methods only when necessary.
(3). a Test class that tests the two Person and OfficePerson classes by initiating appropriate objects.
smata 0 Newbie Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
smata 0 Newbie Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
rhn94 0 Newbie Poster
tkud 0 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.