// public class Inventory { private int productNum; private String name = new String(); private int units; private double price; // All getters and setters public int getproductNum() { return productNum; } public void setproductNum(int productNum) { this.productNum = productNum; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getUnits() { return units; } public void setUnits(int units) { this.units = units; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } // Constructors Inventory() { // Empty Constructor } //Constructor that takes arguments Inventory(int _productNum, String _name, int _units, double _price) { //Constructor productNum = _productNum; name = _name; units = _units; price = _price; } //Computes value of inventory public double valueOfInventory() { return price * units; } //displays the details of the inventory public void showInventory() { System.out.println(); // outputs a blank line // output messages System.out.println("Product Name: "+name); System.out.println("Product Number "+productNum); System.out.println("Number of Units = "+units); System.out.println("Unit Price $"+price); //valueOfInventory() method and display the value System.out.println("Inventory value of "+name+ " is = "+valueOfInventory()); } }