Using Java, please write the program.

A grocery store sells many different items. Construct an abstract class Item with attributes String name double unit Price. The methods of Item are getters and setters along with the requisite constructors, and one abstract method double cost that returns the cost of the item UnitItem and Weightltem are concrete classes that extend Item. An object belonging to Unit Item encapsulates a grocery item that is sold by the unit, such as a can of soup or a gallon of milk. The instance variable unitPrice (inherited from Item) stores the price of one item. Unitltem has an additional instance variable, amount, that holds the number of units of a particular item. Unitltem implements the method double cost0 that returns the cost of amount units of an item Weightltem represents an item sold by weight, such as nuts, fruits, or vegetables. In this case, unitPrice represents the price per pound of an item. Weightltem has an additional instance variable, weight, that holds the number of pounds of some item. Weightltem also implements the method double cost0 returns the total cost of weight pounds of the item Both classes should include the appropriate constructors as we as getter and setter methods a. Design and implement ltem, Weightltem, and Unitltem. Test your methods. b. A ShoppingCart class has a list of Item such that each element is a Unitltem or a Weightltem reference. Additionally, ShoppingCart implements a method void checkout that determines the total cost all items in the "cart," that is the list. A typical call to checkout0 might produce the following interactive output

Login to view answer.