Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
8th Edition
ISBN: 9780133769395
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 18, Problem 12PC

Inventory Bin Stack

Design an inventory class that stores the following members:

serialNum: An integer that holds a part’s serial number.

manufactDate: A member that holds the date the part was manufactured.

lotNum: An integer that holds the part’s lot number.

The class should have appropriate member functions for storing data into, and retrieving data from, these members.

Next, design a stack class that can hold objects of the class described above. If you wish, you may use the template you designed in Programming Challenge 1 or 2.

Last, design a program that uses the stack class described above. The program should have a loop that asks the user if he or she wishes to add a part to inventory, or take a part from inventory. The loop should repeat until the user is finished.

If the user wishes to add a part to inventory, the program should ask for the serial number, date of manufacture, and lot number. The data should be stored in an inventory object, and pushed onto the stack.

If the user wishes to take a part from inventory, the program should pop the top-most part from the stack and display the contents of its member variables.

When the user finishes the program, it should display the contents of the member values of all the objects that remain on the stack.

Blurred answer
Students have asked these similar questions
True or False The objects of a class can be stored in an array, but not in a List.
java programing    Design an inventory class that stores the following members serialNum: an integer that holds a part’s serial number manufactDate: a member that holds the date the part was manufactured lotNum: an integer that holds the part’s lot number The class should have appropriate member functions (interfaces) for storing data into, and retrieving data from, these members. Then, design a program that uses the queue class. The type of the queue should be the above inventory. The program should have a loop that asks the user whether he or she wishes to add a part to inventory or take a part from inventory. The loop should repeat until the user is finished. If the user wishes to add a part to inventory, the program should ask for the serial number, date of manufacture, and lot number. The information should be stored in an inventory object using inventory interfaces and added into the inventory queue. If the user wishes to take a part from inventory, the program should remove the…
Data Structure & Algorithum java program Do the following: 1) Add a constructor to the class "LList" that creates a list from a given array of objects.2) Add a method "addAll" to the "LList" class that adds an array of items to the end of the list. The header of the method is as follows, where "T" is the generic type of the objects in the list. 3) Write a Test/Driver program that thoroughly tests all the methods in the class "LList".

Chapter 18 Solutions

Starting Out with C++ from Control Structures to Objects (8th Edition)

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License