Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming assignment using c++ and std library For programming assignment 2 we are going to work with infix to postfix conversion. The starting point for

Programming assignment using c++ and std library image text in transcribed
image text in transcribed
For programming assignment 2 we are going to work with infix to postfix conversion. The starting point for the assignment is the infix to postfix conversion program provided by the textbook (program 7-3). A code blocks project with all the associated header files for this program is uploaded on canvas for your starting point. As provided the program issues two warnings and the error and exception handling does not work. The warnings are minor and do not cause a problem. Do not worry about the exception handling at this point. We are going to cover exception later in the course. If you input an invalid expression the program will lock up. You can just restart if that happens. At first run the program with the examples to see how the program functions. The main task of the assignment is to write your own stack class and use your stack to replace the stack from the standard library used by program 7-3. Program 7-3 uses the standard library stack in two places d rpn.h and d inftop.h. Your stack must use a dynamically allocated array that grows as needed to store stack the items. We covered how to do this in class with the miniVector class. The miniVector class is included with the material for the assignment. Your stack will also need to have functions top, push, pop, size and empty. These are the functions required by program 7-3. Your stack should also include a destructor to release the dynamically allocated memory at the programs completion. Hint: if you use a template class you only have to implement a single stack class for this assignment. Test your stack by pushing 0 through 9 on to the stack. Then use top to read the top value and pop to remove all elements from the stack. If your stack is working correctly you should get 9 through 0 out. After removing all ten items from the stack the empty function should return true. Include this output in your report to show that your stack is working

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

1. What might have led to the misinformation?

Answered: 1 week ago