// Inventory program part 1 Inventory1.java
//
// A product class that stores and makes the name of the product, the item number, the number of units in stock, and the price of each unit retrievable.
// Java app. that displays the product name, the item number, price of each unit, and the value of inventory.
import java.util.Scanner; import java.text.NumberFormat; import java.text.DecimalFormat;
class Product
{
private String name; // product name private int number; // product part number private double price; // product unit price private int quantity; // products in stock
public Product(String N, int Num, double P, int Q) // Constructor { name = N; number = Num; price = P; quantity = Q; }
// Getters and setters public void setName(String N) // method to set product name { name = N; }
public String getName() // method to get product name { return name; }
public void setNumber(int Num) // method to set part number { number = Num; }
public int getNumber() // method to get part number { return number; }
public void setPrice(double P) // method to set unit price { price = P; }
public double getPrice() // method to get unit price { return price; }
public void setQuantity(int Q) // method to set product quantity { quantity = Q; }
public int getQuantity() // method to get product quantity { return quantity; }
public double getTotalPrice() // return the total value of the inventory { double TotalPrice = quantity * price; return TotalPrice; }
} // End class product
public class Inventory1
{
//