> This is what I have done so fare but I need to use an array to store
> items. The output needs to display the information one product at a
[quoted text clipped - 3 lines]
> the entire inventory. I have done this last part but it only brings up
> 0.0 instead of the total.
<useless comments snipped>
> import java.util.Scanner;
> class inventory
> private String productname; // name of movie
> private double productnumber; // product number
> private double numberinstock; // number of movie in stock
> private double priceofitem; // the price of the movie
> public void getproductname(String productname)
That should be setproductname (or it should'n be void and the body
should retyrn productname)
> {
> productname = productname;
Unless I am mistaken, that's not going to do anything. Maybe you meant
this.productname = productname;
> }
> // gets the product number
> public void setproductnumber(double productnumber)
> {
> productnumber = productnumber;
this.productnumber = productnumber;
> }
> public double getproductnumber()
> {
> return productnumber;
> }
> // gets the number in stock
> public void setnumberinstock(double numberinstock)
Comments like this are harmful, not helpful, they confuse the reader. Is
it a setter or a getter?
> {
> numberinstock = numberinstock;
[quoted text clipped - 15 lines]
> // This calculates the value of inventory, but i can not get it
> to work
Probably because of the above-noted defect in your setters.
> public double value()
> {
> return numberinstock * priceofitem;
> }
>
> } // end of class
<snip>