PLEASE HELP! Inventory program part 3
I have been working on this program nonstop and keep deleting everything I add because it keeps compiling errors ugh.
Here are the requirements.
· Modify the Inventory Program by creating a subclass of the product class that uses one additional unique feature of the product you chose (for the DVDs subclass, you could use movie title, for example).
· In the subclass, create a method to calculate the value of the inventory of a product with the same name as the method previously created for the product class.
· The subclass method should also add a 5% restocking fee to the value of the inventory of that product.
· Modify the output to display this additional feature you have chosen and the restocking fee.
· Post as an attachment
Here is what I have so far and it compiles ok except a couple odd outputs but still runs.
Code:
package javaapplication6;
public class Inventory2 {
Inventory2() {
VG[] vgame = new VG[4];
vgame[0] = new VG("Final Fantasy 7", 2000, 16, 12.0,"Rpg");
vgame[1] = new VG("Modern Warfare 2", 60000, 49.99, 900.0,"First person shooter");
vgame[2] = new VG("Super Street Fighter ", 40000, 39.99,400.0,"Fighter");
vgame[3] = new VG("Halo Reach",20000,59.99,600.0,"First person shooter");
for(int i = 0; i < 4; i++) {
System.out.println(vgame[i]);
System.out.println();
System.out.println("Product Title is : " + vgame[i].getVgametitle());
System.out.println();
System.out.println("The number of units in stock is " + vgame[i].getVgamestock());
System.out.println();
System.out.println("The price of each game is: " + vgame[i].getVgameprice());
System.out.println();
System.out.println("The item number is : " + vgame[i].getVgameitem());
System.out.println();
System.out.println("The value of the inventory is : " + vgame[i].Vgamevalue());
System.out.println();
}
}
public static void main(String args []) {
new Inventory2();
}
class VG {
private String Vgametitle;
private double Vgamestock;
private double Vgameprice;
private double Vgameitem;
private double Vgamevalue;
VG(String title, double stock, double price, double item) {
Vgametitle = title;
Vgamestock = stock;
Vgameprice = price;
Vgameitem = item;
}
public void setVgametitle(String title) {
Vgametitle = title;
}
public String getVgametitle() {
return Vgametitle;
}
public void setVgamestock(double stock) {
Vgamestock = stock;
}
public double getVgamestock() {
return Vgamestock;
}
public void setVgameprice(double price) {
Vgameprice = price;
}
public double getVgameprice() {
return Vgameprice;
}
public void setVgameitem(double item) {
Vgameitem = item;
}
public double getVgameitem() {
return Vgameitem;
}
public double Vgamevalue() {
return Vgameprice * Vgamestock;
}
public class VGG extends Inventory2 {
private String Vgamegenre;
public void setVgamegenre(String genre) {
Vgamegenre = genre;
}
public String getVgamegenre() {
return Vgamegenre;
}
}
}