Question
Question: C++ Define A Class Named Inventory With These Member Variables: - Retailer: A String That Is Used To Store The Name Of Retailer A
Question:C++ Define A Class Named Inventory With These Member Variables: - Retailer: A String That Is Used To Store The Name Of Retailer
A function named display (to display all available items and their prices), this function has no input argument There is no need for any other member function such as removing or sorting items. Write a test main function that adds 3 items and displays available items at the store. A function named add which adds an item A destructor to free allocated memory for itemNames and prices A constructor that accepts: retailer, and capacity. It set numItems=0 and allocates memory for itemNames and prices Default constructor that sets: retailer=Walmart, capacity=100, numItems=0 and allocates memory for itemNames and prices 1 mutator functions (for retailer) 3 accessor functions (for the first three member variables) C++ Define a class named Inventory with these member variables: - retailer: a string that is used to store the name of retailer (such as Walmart) - capacity: maximum number of items (an integer) - numItems: actual number of items (an integer) - itemNames: a pointer to string (which is used for an array with names of the items sold at the retailer) - prices: A pointer to Money (which is used to create an array of prices of the items sold at the retailer) Member functions include:
Step 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