Question: Problem 1 Shopping Cart 12 points Implement a program that tracks customers purchases. Create the following classes. Use appropriate access modifiers (instance variables should be

Problem 1 Shopping Cart 12 points Implement a program that tracks customerspurchases. Create the following classes. Use appropriate access modifiers (instance variables shouldProblem 1 Shopping Cart 12 points 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.be private!) and data types for each. Dont forget to add getter

Santa Monica College CS 52-C+Programming Assignment #5-00P/ Inheritance Points: 30 Instructions (3 points) 1. Write a commen at the top that contains the following information / cs s2 // Assignment #5 Properly indent, format and comment your code as necessary 2. Warning:-No late submission is accepted Points will be deducted for entirely commented files Name your files problem}.cpp, for example probleml.cpp, problem2.cpp, etc. Canvas may append-1, such as problem2-I.cpp which is akay Shopping Cart Implement a program that tracks custoeners' puarchases. Create the following classes. Use Problem1 12 points appropriate access modifers (instance variables should be private!) and data types for each. Don't Sorget to add getter and setter furctions. item: This class has the attrbutes [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 boueht, You may Emit the number of items in the cart. The cart should have functions to add an item and print the tems 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 shoppine cart object. . Finally, implement a nain 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. Problem 2 Pizza 15 points Implement a program that creates pizzas based on user order. First, create class called Ingredient with one instance variable description of type sring which is set in the constructor and can be get using a getter function. Create the following classes that derive from Ingredient: TomatoSauce, Cheese, Dough, and Pepperoni; each with a constructor that passes the dercription argument to the base constructor. Use proper access modifiers

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!