Solved

Mini-mart Inventory control system

Posted on 2006-06-21
5
1,458 Views
Last Modified: 2008-03-10
I need to do a project on inventory systm but I really bad with c++. My requirements are : Input Stock, sales item, replenishment of items, report generation. How do i link all this 4 by using array and do/while ? All i need a simple programme code example to work on.
0
Comment
Question by:PRABAUSHA
  • 2
5 Comments
 
LVL 2

Assisted Solution

by:gran88
gran88 earned 150 total points
ID: 16951746
An array of pointers would be your best best.  Here's some pseudo code

declare array;
do
{
  fill up array;
}
while (array isn't full);

generateReport();
printReport();

Have fun with the data entry!
0
 
LVL 10

Accepted Solution

by:
Andrew Beers earned 350 total points
ID: 16954480
o.O;

array of pointers!?

...

Your telling someone someone who said "I really bad with c++. " To use pointers?  *cough*Memory Leak*cough*

((Also this question belongs in C++ not Game Dev))

Your best off finding a prebuilt linked list structure that manages memory control for you.  Your nodes will be your inventory objects, and whne you need to remove or insert data you can just use a linked lists insert function.  Using an array of pointer objects still leaves you with reorganizing arrays when your linked list structure will allow you to remove data after it's been sold and reported on to free up additional memory.

Amazingly a tripod site has a decent explination of creating a linked list in c++:

http://richardbowles.tripod.com/cpp/linklist/linklist.htm

Then you create a class to manage the inventory items.. your node will just be a pointer to an object (The linked list structure you find should handle this for you as far as destroying the object):
http://www.gillius.org/ooptut/

Between those two sites you should have no problem and enough sample code to cut and paste the entire project.

Good Luck,
Aqua

0
 

Author Comment

by:PRABAUSHA
ID: 16957680
Thanx guys..
0
 
LVL 10

Expert Comment

by:Andrew Beers
ID: 16960185
((Thanx guys)) and a B?  o.O;  Did you want us to write the program for you?

~Aqua
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question