Click here to Skip to main content
15,888,142 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear All,

Is anybody knows solution of below C++ question?

I need your help. Please send me the solution ASAP

Q: Create a C++ class for stock item abstract data type. It should have the attributes of stock levels (an integer) and unit price (a float). Define the methods to return the values of these two attributes and to set them using parameters. Add two more methods to allow stock receipts and issues updating the stock level as appropriate. Write a menu driven program to implement the above problem.
Posted
Updated 20-May-12 23:51pm
v2

Well I'm sure there are at least 10 people on here I correspond with regularly that could do this for you. And for each of them there's probably another 10 who could that I don't know. The good thing for them and the bad thing for you is that they've got degrees/experience already and you haven't.

So go back to your textbook(s) and look up basic OO design, information hiding and constructors. If you don't know that now then I hope your academic year doesn't end in June the way most do in the UK.

Oh, and while you're at it, for additional credit, consider the pros and cons of using a float for unit price. It sounds like a bad idea to me but perhaps your lecturer has a reason. Otherwise he's barking and you should claim your course fees back :-).
 
Share this answer
 
Comments
huzaifa.osman 21-May-12 6:54am    
If you people don't know the solution don't pass your foolish comments here. If I know how to design abstrat class in C++ than why I posted this? For your information this is not my homework. One of my friend needs the solution.
Aescleal 21-May-12 7:35am    
Get your friend to post the question then and everything he's done so far to solve it. And if you think my comments are foolish then don't follow the advice in the second paragraph and see where it gets you.
Stefan_Lang 21-May-12 12:39pm    
This is not about you or your friend, this is about homework and help. The point about homework is the best way to help the one it's assigned to, is let them do it! That doesn't mean we deny any help: of course we will answer specific questions, or give a nudge in the right direction when you're stuck.

But, doing the entire homework ourselves and posting it here would be the opposite of helping!
Stefan_Lang 21-May-12 12:34pm    
Good advice and good hint about the choice of type for a price variable: floats (for monetary amounts) are almost always a very bad idea indeed!

Have a 5!
Well, you should do you own homework. Start designing your abstract class and post here specific questions whenever you're stuck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900