Write your own version of a class template

Assignment Help Computer Engineering
Reference no: EM132178471

C++ program with output. please don't post that solution that are already in Chegg.

Assignment 1

Write your own version of a class template that will create a dynamic stack of any data type. The pop function must return a bool; it should return a false if it was not able to pop an item off the stack.

Otherwise it returns true. The parameter to the pop function is passed by reference and should be the item on the list if it was able to pop something.

Create a driver program (main) that shows that the stack works for at least two different data types.

Assignment 2

In this program you will use the stack class you created in Assignment 1. First you will create a class called InventoryItem. This class will have its class declaration in InventoryItem.h and its implementation in InventoryItem.cpp.

It will have three private data members, an integer serialNum which holds the part's serial number, manufactDate which should be a string that holds the date the item was manufactured, then lotNum which will be an integer that holds the part's lot number.

The program should then create a stack with a data type of InventoryItem (stack). The program should loop asking the user to enter in new items to the inventory stack or to remove an item from the inventory stack. The loop should continue until the user indicates they are done.

This should be menu driven. When adding an item, the program should ask the user for the information it needs for the 3 data members of the InventoryItem class and add a new item to the stack. When removing an item from the stack, the program should display all of the information in the InventoryItem object that was popped off the stack.

When the program ends, it should pop all of the remaining items off the stack and display the data that is in the Inventory items as it pops them off. There should be 3 utility functions that main uses.

void popItem(DynStack* stack) // pops the item off the stack and displays it.

void pushItem(DynStack* stack) // pushes the item onto the stack

int menu(); // displays the menu and returns the user's choice.

Reference no: EM132178471

Questions Cloud

Sampling distribution of the sample mean : There might be several true statements. Each correct answer gives a mark. In you select an answer incorrectly, a mark will be subtracted.
Normal distribution with a standard deviation of 7 : It is known that tree heights follow a normal distribution with a standard deviation of 7.
Create a program plan and then convert : Create a program plan and then convert it into C++ statements. Practice debugging, declaring variables, file I/O, functions, arrays, sorting and searching array
Mean weight of chocolate per box : Using the data they collected, the family would like to test whether µ, the mean weight of chocolate per box, is less than their original signature box.
Write your own version of a class template : Write your own version of a class template that will create a dynamic stack of any data type.
What percentage of the test scores was at least 60 : a. What percentage of the test scores was at least 60? b. What percentage of the test scores was at most 89?
Describe the steps necessary to configure the servers : You want to form a PKI consisting of several CA servers that will deploy certificates to the users and computers.
Find the 1st quartile of the male height distribution : Find the 1st Quartile (Q1) of the male height distribution What is the probability that a randomly selected female is above 68 inches height?
Determine the worst-case complexity of each : Determine the worst-case complexity of each of the following methods in terms of n and k.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd