cpp3_code_f07 - USERNAME NAME EX3-F07 1 20 pts This...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: USERNAME ___________________ NAME __________________________________ EX3-F07 1. ( 20 pts ) This question is related to the Stack Class in the multiple-choice section of this test. Instead of single push() and pop() operation, we define a series of operations as a string. For example: “u5u4pu2ppu1” denotes the following operations: push 5 – push 4 – pop – push 2 – pop – pop – push 1. In other words, if we declare myStack as a Stack object, the statement myStack.seriesOperation(“u5u4pu2ppu1”) is equivalent to: myStack.push(5); myStack.push(4); myStack.pop(); myStack.push(2); myStack.pop(); myStack.pop(); myStack.push(1); As you can see “u” represents push, and “p” represents pop. Assume that after letter “u” there will always be a single digit number . You are asked to add this method to the Stack class. The prototype of the method is given by: void Stack::seriesOperation(string s);--------------------------------------------- Your Solution --------------------------------------------...
View Full Document

This note was uploaded on 09/05/2011 for the course CGS 2421 taught by Professor Onal during the Fall '09 term at University of Florida.

Page1 / 3

cpp3_code_f07 - USERNAME NAME EX3-F07 1 20 pts This...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online