Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C$52-Assignmento5.pf Adobe Acrobat Reader DC File Edit View Windaw Help Home Tools CS52-Assignmento... x Sign In Problem 1 Shopping Cart 12 points Implement a program

image text in transcribedimage text in transcribedimage text in transcribed

C$52-Assignmento5.pf Adobe Acrobat Reader DC File Edit View Windaw Help Home Tools CS52-Assignmento... x Sign In 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 private!) and data types for each. Don't 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 Movie: This class inherits from Item. It has an instance variable called length. o 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 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 shopping cart object. 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. 8.50 11.00 in C$52-Assignmento5.pf Adobe Acrobat Reader DC File Edit View Windaw Help Home Tools CS52-Assignmento... x Sign In 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 private!) and data types for each. Don't 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 Movie: This class inherits from Item. It has an instance variable called length. o 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 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 shopping cart object. 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. 8.50 11.00 in

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions