Write a class CartItem (name, price, quantity, addQuantity, subtotal, toString formatted %-10s %2d x %6.2f = %7.2f) and a public class ShoppingCart that keeps an ArrayList<CartItem>.
Commands until the end of input:
add NAME PRICE QTY— adding a product already in the cart (ignore case) increases its quantity instead of adding a second line;remove NAME— printsremoved Teaornot in cart: Tea;show— prints every item and3 products, 7 units, total 58.40.
Write a helper int indexOf(ArrayList<CartItem> cart, String name).