Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,395 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,119 people online right now. Registration is fast and FREE... Join Now!




Inheritance/Composition

 
Reply to this topicStart new topic

Inheritance/Composition

cire_1803
20 Sep, 2006 - 04:01 AM
Post #1

New D.I.C Head
*

Joined: 20 Sep, 2006
Posts: 43


My Contributions
Can anyone suggest a program to make with 7 classes, inheritance/composition, a model of the objects. I need you reply ASAP.
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Inheritance/Composition
20 Sep, 2006 - 05:14 AM
Post #2

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Humans.

Have one base class called Living_things.
Then a class as Human which is derived from living things.
Some more classes like birds, Animals etc. which are derived from Living_things.
Have two more classes (Male and Female) which are derived from Human.

And the list can go on and on...choose a limited set of classes and you'll get it down to seven.

There are so many functions you can use to emulate the real world objects.
User is offlineProfile CardPM
+Quote Post

cire_1803
RE: Inheritance/Composition
22 Sep, 2006 - 01:36 AM
Post #3

New D.I.C Head
*

Joined: 20 Sep, 2006
Posts: 43


My Contributions
can you give an example of a class declaration, class member?
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Inheritance/Composition
22 Sep, 2006 - 04:44 AM
Post #4

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,230



Thanked: 40 times
Dream Kudos: 25
My Contributions
Classes:

http://www.cplusplus.com/doc/tutorial/classes.html

http://www.cplusplus.com/doc/tutorial/classes2.html

http://www.cplusplus.com/doc/tutorial/inheritance.html

http://www.cplusplus.com/doc/tutorial/polymorphism.html
User is offlineProfile CardPM
+Quote Post

cire_1803
RE: Inheritance/Composition
22 Sep, 2006 - 02:38 PM
Post #5

New D.I.C Head
*

Joined: 20 Sep, 2006
Posts: 43


My Contributions
QUOTE
Humans.

Have one base class called Living_things.
Then a class as Human which is derived from living things.
Some more classes like birds, Animals etc. which are derived from Living_things.
Have two more classes (Male and Female) which are derived from Human.

And the list can go on and on...choose a limited set of classes and you'll get it down to seven.


can you give me a sample class declaration of this classes?
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:50AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month