Posted: Fri Nov 25, 2011 11:10 am Post subject: C++ program. ineed help. please send me a code
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.
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
Posted: Sun Nov 27, 2011 11:45 am Post subject:
This sounds more of a homework question. This is really basic C++ stuff, and unless you need it for homework I don't see why you would need the code for this. I suggest you try to learn how to develop this yourself. You can find information on classes here:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum