Question: Using c++ Problem 1 Implement a program that tracks customers' purchases. Create the following classes. Use appropriate access modifiers (member variables should be privatel) and

Using c++  Using c++ Problem 1 Implement a program that tracks customers' purchases.

Problem 1 Implement a program that tracks customers' purchases. Create the following classes. Use appropriate access modifiers (member variables should be privatel) and data types for each. Don't forget to add getter and setter functions. Shopping Cart 27 points Item: This class has the attributes (member variables) called title, description, and price. It has a pure virtual function called print that prints the type and description of the current object to the console. This function is NOT implemented in this class but must be implemented/overridden in the three subclasses below. 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. o o ShoppingCart: This class keeps track of items that were bought. it has a single constructor which expects the maximum number of items that can be placed in the cart. It must have a dynamically allocated array of pointer to an item object (item*array- new Item [size]) which is initialized in the constructor. The cart must have functions to add an item and print the items currently in the cart to the console by calling each object's print() function. Customer: The customer class stores an id, the first name and the last name and a pointer to a shopping cart object which gets initialized in the constructor. Finally, implement a main function that creates a customer. Then add one item of each type to the customer's shopping cart and list the items in the cart on the console. *Note: fields, attributes, properties, member variables, instance variables all refer to the same thing: variables defined inside a class as part of an object, not inside fiunctions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!