Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi everyone. This is an assigment from Absolute C++ 5th edition The assignment r

ID: 3538324 • Letter: H

Question

Hi everyone. This is an assigment from Absolute C++ 5th edition

The assignment reads:

Modify the source code for the Stack class from Chapter 17 , shown in Displays 17.17

through 17.19 . Currently, if the user of the class attempts to pop from an empty

stack the program prints out an error message and exits. Modify the program so

that it instead throws an exception named PopEmptyStackException.

Write a main function that tests the new Stack class, attempts to pop from an

empty stack, and catches the PopEmptyStackException exception



It is refering to this class

header

http://www.cs.fsu.edu/~myers/savitch3c++/Ch17/17-17.h

implementation

http://www.cs.fsu.edu/~myers/savitch3c++/Ch17/stack.cpp


if you could write a small program to test it it would be great.

thanks.


Explanation / Answer

please find the files here


http://pastebin.com/hWqjPnSn      - stack.cpp

http://pastebin.com/91aP4rnD       - stack.h

http://pastebin.com/ztj4f21x          - main.cpp


compile using: g++ main.cpp

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote