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

  Develop the concrete rtn

Develop the concrete RTN and the control sequence to implement the neg instruction for the 1-bus design.

  Was the leadership team afraid of change

Select an organization or industry that is facing significant change - Why were the leaders of your chosen company or industry unable to adapt to the changing

  How you came to your final vlan design any problems that

your organizations datacenter is located on one of the floors of the building that the organization rents. it has 6

  Write a mips program guess

Write a MIPS program guess which tries to guess what number you have chosen in as few guesses as possible. It can only ask you whether the number is less than some other number.

  What are the best practices in writing program

What are the best practices in writing program? Describe each one briefly

  Questionthe fibonacci sequence is series of integers0 1 1 2

questionthe fibonacci sequence is series of integers.0 1 1 2 3 5 8 13 21 34 55 89observe the pattern? each element in

  Use ftk or winhex to identify

Use FTK or WinHex to identify which files have wrong extension (you need to know the correct file signatures).

  Medium access control methods

Task 1: Both the CSMA/CD with Token bus medium access control methods can be used in real time systems. Which one is better suited for real time applications? Explain.

  Create a connection socket when contacted by the client

Create a connection socket when contacted by the client (browser). Receive the HTTP request from this connection.

  Write a program that prints yourname

Input the number of quarters, dimes, nickels, and pennies from the user. Print out the number of coins and total value in dollars.

  Give a program that reads a 5 x 5 two-dimensional array

Write down a program that reads a 5 x 5 two-dimensional array of integers and then prints the row sums and the column sums.

  What types of vulnerabilities need to be addressed

What challenges will need to be addressed with the U.S. Navy project described in your scenario? What types of vulnerabilities need to be addressed.

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