public class Store { public static void main(String[] args) { Product candy = new Product("Candy bar", 0.99); Produce apple = new Produce("Apple", 1.69, 1.3); System.out.println("Display " + apple); System.out.println("Cost " + apple.cost()); System.out.println("-----"); System.out.println("toString cretes the string " + apple); System.out.println("Name " + candy.getName()); System.out.println("Price " + candy.getPrice()); System.out.println("Price with tax " + candy.priceWithTax()); // to do: create three more products (like item1). Pick name and price. Product item2 = new Product("other", 1.0); Product item3 = new Product("Pizza", 5.67); Product item4 = new Product("Soap", 1.39); // create any array Product list[] = new Product[4]; // to do: add all 4 items to the list array list[0] = candy; list[1] = item2; list[2] = item3; list[3] = item4; for(int i=0; i < list.length; i++){ System.out.println(list[i]); } double total = 0.0; for(int i=0; i < list.length; i++){ total = total + list[i].getPrice(); } System.out.println("Total price " + total); total = 0.0; // reset for(int i=0; i < list.length; i++){ total = total + list[i].priceWithTax(); } System.out.println("Total price with tax " + total); } }