Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help C++. Design a set of classes and functions to manage an online store. The first class should represent an item that can be
Please help C++.
Design a set of classes and functions to manage an online store. The first class should represent an item that can be bought in the store. An item should have a user-friendly name (i.e. "Book") represented as a std::string as well as an id which should be represented as a long value. Every item should have a price represented as a double as well as an int indicating how many are in stock. The second class should represent a store, which contains a list of all the items currently available in the store. Represent this as an array of Item objects. Assume that there will never be more than 100 objects in the list. Provide a function to print out the full contents of the store with each item and the number of that item in stock: example Store: Book x 12 Colored Pencils x 15 Coloring Paper x 20 Markers x 50 Crayons x 3 Staples x 7 NOTE: Keep in mind that you are only writing the classes and functions. You can provide example code that actually creates an instance of this class and calls the function to print the result as in the above example, but I will not be checking for this or running these test functions. I am only going to look at the class and function definitions so ensure that they would behave according to the above example, given the right setup and input. The third class should represent an order. An order should consist of a list of items. Assume there are never more than 10 items in the order's list. Provide a member function that allows you to add items to the order, as well as a getter function that returns the total price of all the items in the current order. NOTE: You are free to use std::vector rather than raw arrays for this assignment, however this is not required since we have not yet learned about using std::vectorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started