Question: This is an JAVA assingment not C++.Please be careful about it. JAVA Project Inheritance Instructions 1. Write a comment at the top that contains the
This is an JAVA assingment not C++.Please be careful about it.
JAVA Project Inheritance Instructions 1.
Write a comment at the top that contains the followinginformation // Your Name // Comment //
2. Properly indent, format and comment your code as necessary Warning: -
Shopping Cart Implement a program that tracks customers purchases. Create the following classes. Use appropriate access modifiers (instance variables should be private!) and data types for each. Dont forget to add getter and setter functions. Item: This class has the attributes (member variables) called title, description, and price. o Book: This class inherits from Item. It has an instance variable called pageCount. o Movie: This class inherits from Item. It has an instance variable called length. o CD: This class inherits from Item. It has an instance variable called trackCount. ShoppingCart: This class keeps track of items that were bought. You may limit the number of items in the cart. The cart should have functions to add an item and print the items currently in the cart to the console. Customer: The customer class stores an id, the first name and the last name and a pointer to a shopping cart object. Finally, implement a main function that creates a customer. Then add one item of each type to the customers shopping cart and list the items in the cart on the console.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
