Answered step by step
Verified Expert Solution
Link Copied!

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++.

image text in transcribed

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::vector

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

Step: 3

blur-text-image

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

3. Opt for the familiar word, the one that is not pretentious.

Answered: 1 week ago

Question

b. Will there be one assigned leader?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago