Using Inheritance in Book Inventory Project

OOP using c++

Page 1 of 1

12 Replies - 1503 Views - Last Post: 29 December 2009 - 10:55 AM Rate Topic: -----

#1 cindrellacool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 04-October 09

Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:02 AM

my project name is book shop inventory system.i want to use classes in it.
is it ossible to use inheritance in it?plz guide me
Is This A Good Question/Topic? 0
  • +

Replies To: Using Inheritance in Book Inventory Project

#2 kidicarus  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 139
  • Joined: 13-February 09

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:20 AM

Yes, in C++ it is possible to use inheritence which is one of the fundamental principles of OOP.
Was This Post Helpful? 0
  • +
  • -

#3 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 308
  • View blog
  • Posts: 1,508
  • Joined: 16-May 09

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:21 AM

Being able to use inheritance depends on how you write your code... If you have 2 or more classes which have similarities in some parts, it's a good idea to make a base class and then inherit the 2 desired classes from that base class, this way you are able to write less code, but remember, bad use of inheritance can result in difficulties and more code.

My advice: plan your classes well on paper... when you think things are fine and efficient, write the codes.

This post has been edited by Anarion: 28 December 2009 - 08:23 AM

Was This Post Helpful? 0
  • +
  • -

#4 cindrellacool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 04-October 09

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:23 AM

for book shop inventory system how can i use it?
Was This Post Helpful? 0
  • +
  • -

#5 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 308
  • View blog
  • Posts: 1,508
  • Joined: 16-May 09

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:27 AM

You have to show effort on solving the problem, we cannot just give you the code! :D
Was This Post Helpful? 0
  • +
  • -

#6 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 990
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:30 AM

Have a read here:
http://www.cplusplus...al/inheritance/

You can't just keep asking people how you would use inheritance.

Write the program as best you can and we can help you make it better but we can't give you code and we can't even make meaningful suggestions without your code in front of us.
Was This Post Helpful? 0
  • +
  • -

#7 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 857
  • View blog
  • Posts: 2,343
  • Joined: 20-August 07

Re: Using Inheritance in Book Inventory Project

Posted 28 December 2009 - 08:53 AM

View Postcindrellacool, on 28 Dec, 2009 - 03:23 PM, said:

for book shop inventory system how can i use it?

Why don't you try learning about OO design and inheritance for yourself, and then you won't need to come here asking for other people to do your assignments for you. This isn't the first thread you've started on these forums, and its certainly not the first time you've had the rules explained to you.
Was This Post Helpful? 0
  • +
  • -

#8 cindrellacool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 04-October 09

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 08:49 AM

im nt asking everyone to give me codes.i knw the rules of dis forums.i ve some confusion in inheritances.thx
Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,663
  • Joined: 23-August 08

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 08:54 AM

We don't have nearly enough information to assist you in developing an inheritance hierarchy.
Was This Post Helpful? 0
  • +
  • -

#10 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 615
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 09:01 AM

Inheritence allows a (derived) class to inherit another (base) classes public and protected memebers. It is also an important part of polymorphism in C++, especially when used with virtual methods. You can find lots of examples of inheritence, here for example. good luck :)
Was This Post Helpful? 0
  • +
  • -

#11 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 308
  • View blog
  • Posts: 1,508
  • Joined: 16-May 09

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 09:11 AM

View Postcindrellacool, on 29 Dec, 2009 - 06:19 PM, said:

im nt asking everyone to give me codes.i knw the rules of dis forums.i ve some confusion in inheritances.thx

Really?!!

PostingRules said:

2. Use proper English. Correct grammar and spelling is required.
This

This post has been edited by Anarion: 29 December 2009 - 09:12 AM

Was This Post Helpful? 0
  • +
  • -

#12 cindrellacool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 04-October 09

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 10:43 AM

View PostAnarion, on 29 Dec, 2009 - 08:11 AM, said:

View Postcindrellacool, on 29 Dec, 2009 - 06:19 PM, said:

im nt asking everyone to give me codes.i knw the rules of dis forums.i ve some confusion in inheritances.thx

Really?!!

PostingRules said:

2. Use proper English. Correct grammar and spelling is required.
This

i also remember dis rule.i ve no enough tym to check my spellings :rolleyes:
Was This Post Helpful? 0
  • +
  • -

#13 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,663
  • Joined: 23-August 08

Re: Using Inheritance in Book Inventory Project

Posted 29 December 2009 - 10:55 AM

Quote

i also remember dis rule.i ve no enough tym to check my spellings

You've got to be kidding me. OK, this has exceeded my tolerance for inanity.

Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1