I need help coding this in java:
Write a class named GroceryList that represents a list of items to buy from the market, and another class named GroceryItemOrder that represents a request to purchase a particular item in a given quantity.
The GroceryList should use an ArrayList of type GroceryItemOrder to store its list of items to purchase.
GroceryList should have the following methods:
1. A constructor that constructs a new (initially empty) groceryList
2. A method: public void add( )
which add a new GroceryItemOrder to the GroceryList
Note: this method should request user input from the keyboard for each new GroceryItemOrder
that is created
3. A method: public double getTotalCost( )
which returns the total cost of all items in the grocery list
4. A method: public void printGroceryList( )
that prints the whole grocery list in the following format:
ITEM QUANTITY COST Each COST Tot.
<item name> _tab_ <item quantity> _tab_ <price per unit> _tab_ <total price>
…
…________________________________________________________________
Total Cost <total cost>