Solved

C++ Help?

Posted on 2000-04-16
5
191 Views
Last Modified: 2010-04-02
I am a first year compsci university student and i'm havin trouble with the
following c++ question.
anyway sort of help would be much appreciated
thanks.

Modify the grocery store program so that it will calculate the profit and keep track of inventory levels for a variable number of grocery items, up to a maximum of 20. For each item the user inputs an item number, a 3 digit integer, the number if items initially on hand, and the number of items sold. Cost and selling prices are stored constant values. Ma and Pa classify items according to customer demand which is calculated as the percentage of items sold per the initial number of items on hand.

demand = items sold/initial on hand x 100

Their classification system is as follows:



0 <= demand < 20      = Poor
20 <= demand < 50      = Low
50 <= demand < 70      = Good
demand >= 70             = Excellent
For each item the program will output the item number, the profit made from sales of that item, the number of that type of item remaining in stock and classify the demand for the item.
After processing details for each item, the program will print out the total profit from all sales, and the average profit per item. Your program should check for valid input.

NOTE: Your program does not need to use sorting or searching!

0
Comment
Question by:chicka20
5 Comments
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2721546
Chicka,
 It is the generally accepted pratice here that homework questions are not answered here. I personally have seen instances where a person will give a pointer, or suggest a link to find out about the question at hand, but to the best of my knowledge it is not permitted to do someone elses homework. Nor should it be. If I answer this for you, what have you learned?

-DrDelphi
0
 

Author Comment

by:chicka20
ID: 2722424
i'm only after any sort of help e.g pointers. i do not wish you to solve this for me as i won't have learnt anything.
0
 
LVL 1

Expert Comment

by:darkskyz
ID: 2724620
what is the T.A. there for? go to him and ask for pointers.
0
 

Accepted Solution

by:
Silus earned 50 total points
ID: 2740542
Try creating a structure for all the data and creating a linked list using that structure.  Then each item entered can be added as it's entered and for the final calculations you can just traverse the list to get the needed information.
0
 

Author Comment

by:chicka20
ID: 2750743
Many Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now