Not sure what it is nedding I'm needing help on coding this program I get back some 2 errors.
What I have is:
public class Inventory
{
private double ItemNumber; //to store Item number
private String ItemName; //to store Item name
private double UnitsInStock; //to store number of units in stock
private double UnitPrice; //to store Unit price
private double InventoryValue; //to store Inventory value
private double TotalInventory; //to store Total Inventory value
public Inventory() //constructor with no initial variables
{
this ("", 0.0, 0.0, 0.0);
}
public Inventory (String name, double number, double stock, double price)
{
ItemName = name; //set Item name
ItemNumber = number; //set Item number
UnitsInStock = stock; //set Units in stock
UnitPrice = price; //set Unit price
}
//method to set the Item name
public void setItemName( String name )
{
ItemName = name; //store the Item name
}
//method to get the Item name
public String getItemName()
{
return ItemName;
}
//method to set the Item number
public void setItemNumber( int number )
{
ItemNumber = number; //store the Item number
}
//method to get the Item number
public double getItemNumber()
{
return ItemNumber;
}
//method to set the UnitsInStock
public void setUnitsInStock( double stock )
{
UnitsInStock = stock; //store the Units in stock
}
//method to get the UnitsInStock
public double getUnitsInStock()
{
return UnitsInStock;
}
//method to set the UntiPrice
public void setUnitPrice( double price )
{
UnitPrice = price; //store the Unit price
}
//method to get the UnitPrice
public double getUnitPrice()
{
return UnitPrice;
}
//method to set Inventory value
public void setInventoryValue(double value)
{
InventoryValue = value;
}
//method to get InventoryValue
public double getInventoryValue()
{
return InventoryValue;
}
public double getInventoryValue()
{
return UnitPrice*UnitsInStock;
}
//method to set TotalInventory
public void setTotalInventory(double value)
{
TotalInventory = total;
}
//method to get TotalInventoty
public double getTotalInventory()
{
return TotalInventory;
} //end method to getTotalInventory
} //end class Inventory
The errors that I am getting are:
F:\java inventory program part 2\Inventory.java:85: error: method getInventoryValue() is already defined in class Inventory
public double getInventoryValue()
^
F:\java inventory program part 2\Inventory.java:94: error: cannot find symbol
TotalInventory = total;
^
symbol: variable total
location: class Inventory
2 errors