Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Inventory Class Design an Inventory class that can hold information for an item in a retail store's inventory. The class should have the following

image text in transcribed

7. Inventory Class Design an Inventory class that can hold information for an item in a retail store's inventory. The class should have the following private member variables. Variable Name itemNumber quantity Description An int that holds the item's number. An int that holds the quantity of the item on hand. A double that holds the wholesale per-unit cost of the item 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, quantity, and cost as arguments. Calls other class functions to copy these values into the appropriate member variables. Then calls the setTotalCost function. Member Function set ItemNumber set Quantity set Cost Description Accepts an int argument and copies it into the itemNumber member variable. Accepts an int argument and copies it into the quantity member variable. Accepts a double argument and copies it into the cost member variable. Returns the value in itemNumber. Returns the value in quantity. Returns the value in cost. Computes and returns the totalCost. getItemNumber getQuantity get Cost getTotalCost

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions