MainApplication.java 810B

1234567891011121314151617181920212223242526
  1. import java.util.ArrayList;
  2. public class MainApplication {
  3. public static void main(String[] args) {
  4. Product beets = new Product("Beets", 21, 145);
  5. Product asparagus = new Product("Asparagus", 12, 15);
  6. Product tomato = new Product("Tomato", 17, 14);
  7. Product leeks = new Product("Leeks", 34, 745);
  8. Product thyme = new Product("Thyme", 11, 276);
  9. Inventory myInventory = new Inventory();
  10. myInventory.setInventory(beets);
  11. myInventory.setInventory(asparagus);
  12. myInventory.setInventory(tomato);
  13. myInventory.setInventory(leeks);
  14. myInventory.setInventory(thyme);
  15. myInventory.printInventory();
  16. System.out.println("Total value of my inventory is: " +
  17. myInventory.getInventoryValue());
  18. }
  19. }