Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HERE IS HOW THE TXT FILE LOOKS LIKE (it is screen shot since I cannot upload txt file) 7. Inventory Class Design an Inventory class

7. Inventory Class Design an Inventory class that can hold information for an item in a retail stores inventory. The class s 

Problem 2: Textbook #7, Inventory Class, page 501 (50 points) HINT: to test Inventory class follow the instruction from the a

global) (constants are fine as ABSOLUTELY NO GLOBAL VARIABLES ALLOWED == ==

HERE IS HOW THE TXT FILE LOOKS LIKE (it is screen shot since I cannot upload txt file)

InventoryTester_Output.txt Inventory tester output with input validation: Enter item number: -2341 ERROR. Please enter a posi 

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 Description itemNumber An int that holds the item's number. quantity An int that holds the quantity of the item on hand. cost A double that holds the wholesale per-unit cost of the item The class should have the following public member functions. Member Function Description default constructor 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 set TotalCost function. constructor #2 Introduction to Classes and Objects Member Function Description Accepts an int argument and copies it into the itemNumber member variable. setItemNumber Accepts an int argument and copies it into the quantity member variable. setQuantity Accepts a double argument and copies it into the cost member variable. setCost get ItemNumber Returns the value in itemNumber. getQuantity Returns the value in quantity. getCost Returns the value in cost. get TotalCost Computes and returns the totalCost. Demonstrate the class by writing a simple program that uses it. This program should validate the user inputs to ensure that negative values are not accepted for item number, quantity, or cost.

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Code Inventoryh pragma once include using namespace std class Inventory private int itemnumber doubl... 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

Fundamental Accounting Principles

Authors: John J. Wild, Ken W. Shaw, Barbara Chiappetta

20th Edition

1259157148, 78110874, 9780077616212, 978-1259157141, 77616219, 978-0078110870

More Books

Students also viewed these Mechanical Engineering questions