Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

Explain the meaning of imputed negligence.

Answered: 1 week ago

Question

What is impulse buying? (p. 319)

Answered: 1 week ago