Question: // Implementation file for the MathStack class #include MathStack.h //*********************************************** // Member function add. add pops * // the first two values off the stack
// Implementation file for the MathStack class #include "MathStack.h" //*********************************************** // Member function add. add pops * // the first two values off the stack and * // adds them. The sum is pushed onto the stack. * //*********************************************** void MathStack::add() { int num, sum; pop(sum); pop(num); sum += num; push(sum); } //*********************************************** // Member functon sub. sub pops the * // first two values off the stack. The * // second value is subtracted from the * // first value. The difference is pushed * // onto the stack. * //*********************************************** void MathStack::sub() { int num, diff; pop(diff); pop(num); diff -= num; push(diff); }
Here is the Driver Class:
#include
DIRECTIONS:
1) Modify the MathStack class to add the additional functions (mult, div, addAll, multAll) and submit the file here named, MathStack.cpp
2) Modify the Driver class to add the additional functions (mult, div, addAll, multAll) and submit the file here named, Driver.cpp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
