User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,565 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,581 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2310 | Replies: 4
Reply
Join Date: Aug 2004
Location: Cairo , Egypt
Posts: 2
Reputation: amrhesham9 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
amrhesham9's Avatar
amrhesham9 amrhesham9 is offline Offline
Newbie Poster

News need idea for project using classes and inheritance

  #1  
Aug 15th, 2004
hello , well i have to deliver a program that demonstraits classes and inheritance , but i don't have any ideas
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: Marin, CA, USA
Posts: 434
Reputation: Chainsaw is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 10
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: need idea for project using classes and inheritance

  #2  
Aug 16th, 2004
How about a sort class? You provide the sort, and to use it someone declares a SUBCLASS of your sort and has to define the COMPARE and SWAP methods.

sort of like qsort() in the standard library except that instead of passing IN a compare proc it is an overrided virtual method.
Reply With Quote  
Join Date: Aug 2008
Posts: 15
Reputation: findsyntax has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 2
findsyntax findsyntax is offline Offline
Newbie Poster

Re: need idea for project using classes and inheritance

  #3  
Aug 21st, 2008
Hi,
I am Rammohan from Bangalore and working as a Technical lead in big IT firm .
Solution for your answer is follows:

What do you want to deliver? You have not specified what you need....
Any way based on my understanding you need to know

1) what is class? How we can implement it?
2) What is inheritance and how we can implement it?

If your answer is YES, then read the following my information and it may help you for your studies or your requirmenet may solve by this...

Classes are data types based on which objects are created. Objects with similar properties and methods are grouped together to form a Class. Thus a Class represents a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects become functions of the class and are referred to as Methods.
For example consider we have a Class of Cars under which Santro Xing, Alto and WaganR represents individual Objects. In this context each Car Object will have its own, Model, Year of Manufacture, Colour, Top Speed, Engine Power etc., which form Properties of the Car class and the associated actions i.e., object functions like Start, Move, Stop form the Methods of Car Class.
No memory is allocated when a class is created. Memory is allocated only when an object is created, i.e., when an instance of a class is created.
Inheritance:

Inheritance is the process of forming a new class from an existing class or base class. The base class is also known as parent class or super class, The new class that is formed is called derived class. Derived class is also known as a child class or sub class. Inheritance helps in reducing the overall code size of the program, which is an important concept in object-oriented programming.
Inheritance is a means of specifying hierarchical relationships between types C++ classes can inherit both data and function members from other (parent) classes. Terminology: "the child (or derived) class inherits (or is derived from) the parent (or base) class"
When would I use inheritance?
As a specification device.
Human beings abstract things on two dimensions: part-of and kind-of. A Ford Taurus is-a-kind-of-a Car, and a Ford Taurus has-a Engine, Tires, etc. The part-of hierarchy has been a part of software since the ADT style became relevant; inheritance adds "the other" major dimension of decomposition.

____________________
Regards,
Rammohan Alampally,
<snip false signature>
Last edited by Ancient Dragon : Aug 21st, 2008 at 7:31 am. Reason: snip false signature
Reply With Quote  
Join Date: Jul 2008
Posts: 889
Reputation: ArkM is just really nice ArkM is just really nice ArkM is just really nice ArkM is just really nice ArkM is just really nice 
Rep Power: 6
Solved Threads: 122
ArkM's Avatar
ArkM ArkM is online now Online
Practically a Posting Shark

Re: need idea for project using classes and inheritance

  #4  
Aug 21st, 2008
Yes, I don't have any ideas why to discuss a delivering of a program that demonstraits classes and inheritance on C language forum...
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: need idea for project using classes and inheritance

  #5  
Aug 21st, 2008
There are lots of examples. For instance

class Person
class student : public person
class teacher : public person
class university : public student, teacher

class animal
class dog : public animal
class cat : public animal
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 5:53 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC