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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.