Question: JAVA Program Shopping Cart The Following is just base start. You have to change it as you wish: Implement a program that tracks customers purchases.
JAVA Program Shopping
Cart
The Following is just base start. You have to change it as you wish: 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.Do not forget to add getter and setter functions.
Item: This class has the attributes (member variables) called title, description, and price.
Book: This class inherits from Item. It has an instance variable called pageCount.
Movie: This class inherits from Item. It has an instance variable called length.
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 andthe last name and a pointer to a shopping cart object.
Very important hint:
Object oriented programing problem solving is very simple if you thinkof real things,we do every day. This project given asbase to see howdoyou expand it Let say you go to Target
buy things
. Target has Shopping Cart
, Items, Customers,
Cashiers,
you pick up Shopping Cart and add item or remove an item. Item knows
its price and where was its location. Shopping Cart knows total amount
of items.
Make sure each class has method of toString( ) alsoalwayshave memberTha tuniquely identifiesthat object.Use comments to list your suggestion to improve this project.buy things
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
