Thanks for any help/advice. If there are any questions I'd be happy to try to answer them.
As far as compiling there hasn't been to much of an issue in its current state.
The only major issue at the moment is my get set methods are not being used.
As far as other things I've tried with the code before I knew set was the mutator I was trying to put my token in the get methods since it isn't void.
First Usage would be in the Inventory Class line 15.
you should not have a "stock" field. When you pass in "String stock", you should parse it, set the appropriate fields, and then throw the stock String away.
Not sure what the intent of your convert methods are but they are riddled with problems. What is your use case for the convert methods? Are they necessary at all?
You have shown us the inventory class, but no item classes. Please consider what should be in which class. You do not usually have a price in an inventory, but in an item. An inventory should read something like this:-
Your inventory class would have restock(), sell() methods, etc, as well as find methods by description or item code. A sell() method would take the number of items sold and alter the counts accordingly.
123 Motherboard: 3
234 Celeron chipset: 2
345 AMD chipset: 2
456 350W power unit: 2
567 650W power unit: 0
678 2GB RAM unit: 3
789 4GB RAM unit 1
987 1TB disc: 1
876 2.5TB disc: 1
765 4 TB disc: 0
Description price etc would be fields of the Item objects.
Randal Mortell wrote:The text file I'm reading in is just numbers. the first four are the product code. the second set is the price and the final set is the quantity on hand. Its the file that we are supposed to use. it doesn't include names for any of the products.
OK, but nevertheless I'd say you're missing a Product class; but I don't know whether you've been told to only write the two classes you've come up with or not.
"Price", for example, is generally associated with a product, NOT with inventory, since (as we all know) businesses are perfectly capable of raising the price of a can of beans or a piston rod while it's on the shelf - and they're unlikely to do it for just one of them.
I think teachers ought to beware of being too prescriptive in programming assignments. Students should know how to decide how many classes are required.