Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Design an Inventory class that can hold information for an item in a retail store's inven- tory. The class should have the following private

C++ image text in transcribed
Design an Inventory class that can hold information for an item in a retail store's inven- tory. The class should have the following private member variables. Variable Name itemNumber quantity cost totalCost Description An int that holds the item's number An int that holds the quantity of the item onhand. A double that holds the wholesale per-unit cost of the item A double that holds the total inventory cost of the item (calculated as quantity times cost) The class should have the following public member functions Member Function default constructor constructor #2 Description Sets all the member variables to 0. Accepts an item's number, quantiry, and cost as arguments. The function should call other class functions to copy these values to the appropriate member variables and then call the setTotalcost Accepts an int argument that is copied to the itentunber member variable setItenNumber setQuantity Accepts an int argument that is copied to the quantity member Accepts a double argument that is copied to the cost member variable Calculates the total inventory cost for the item (quant ity times cost) and stores the result in totalCost Returns the value in itenNunber. Returns the value in quantity Returns the value in cost. Returns the value in totalcost. setCost setTotalcost getQuantity getCost get TotalCost Demonstrate the class by writing a simple program that uses it. Input Validation: Do not accept negative values for item mumber, quantity, or cost

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

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago