Okay let me take one part at a time. I have made some changes and I will post the classes seperately. Here is the inventory 3 class
CODE
public class Inventory3 {
public static void main(String[] args) {
DVD dvd= null;
Inventory inventory [] = new Inventory[8];
dvd = new DVD(0, "Bad Boys", 5, 12.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(1, "Color Purple", 7, 14.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(2, "Madea Family Reunion", 6, 13.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(3, "Diary of a Mad Black Woman", 3, 15.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(4, "Forest Gump", 8, 11.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(5, "How Stella Got Her Groove Back", 2, 12.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(6, "What's love Got to do With it", 7, 15.99);
System.out.println(dvd);
inventory.add(dvd);
dvd = new DVD(7, "Purple Rain", 7, 11.99);
System.out.println(dvd);
inventory.add(dvd);
System.out.printf("\nTotal value of entire inventory is: $%.2f\n",
inventory.getTotalValue());
inventory.sort();
inventory.display();
} // end main
Here is my inventory class
CODE
class Inventory
{
private DVD[] dvd;
int dvdItem;
String dvdTitle;
int dvdStock;
double dvdPrice;
public Inventory(int item, String title, int stock, double price) {
dvdItem = item;
dvdTitle = title;
dvdStock = stock;
dvdPrice = price;
}
// set title
public void setdvdTitle(String title)
{
dvdTitle = title;
}
// set item number
public void setdvdItem(int item)
{
dvdItem = item;
}
public void setdvdStock(int stock)
{
dvdStock = stock;
}
public void setdvdPrice(double price)
{
dvdPrice = price;
}
public String gettitle()
{
return dvdTitle;
}
public int getitem()
{
return dvdItem;
}
public int getstock()
{
return dvdStock;
}
public Double getprice()
{
return dvdPrice;
}
public Double getInventoryValue()
{
return dvdStock * dvdPrice;
}
///Dvd [] dvd = new dvd[number in stock];
public double getTotalValueofAllInventory()
{
double total = 0.0;
for (int i = 0; i < dvd.length; i++)
{
total += dvd[i].getDvdValue();
}
return total;
}
} // end class Inventory
quote name='Martyr2' date='20 Sep, 2007 - 02:43 PM' post='258184']
Yeah I can see why the instructor has said it is incomplete. There are a few things your instructor is looking for here with this. I will cover a few of them with you and show you were you need to look.
1) Base class implementation - This should be where you have defined a "Product" class. This product class should be what you created in part 1 of the project I believe. It is where you have some variables covering the type of product, a couple of methods for calculating the products worth etc.
2) Derived or inherited class - Using your base class Product you are to inherit from it. Remember ever using "extends" in your class?
public class DVD extends Product { Does that ring a bell? Your extended class "is a" type of Product is it not? Look in your book at the chapter called "inheritance" and look at the example where it shows you deriving one object from another using extends.
3) Override a function - This is where the instructor is talking about a subclass that should calculate the inventory value using a same name as in the base class. So in other words, in your base class "product" you might have had a method named "getPrice()" where you returned the products price. In your subclass "DVD" you would also have a function called "getPrice()" which has its own implementation of returning its value (by calling its parent class perhaps) and adding the 5% restocking fee. Look into overriding functions in your book to learn more about this. Tip here is that your instructor may also be looking for a call to the base class to get the value of the product. So your getPrice() function make look something like...
CODE
// Get price and add restocking fee
public double getPrice() {
return super.getPrice() * 1.05;
}
But be sure to ask your instructor if they are looking for a call to a parent class or if just implementing a new version of your override function is sufficient enough.
Hope that helps!

[/quote]