{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


HW1P1_stack_queue.rtf - CS311 Yoshii Homework 1 Part 1...

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

View Full Document Right Arrow Icon
CS311 Yoshii - Homework 1 Part 1 Getting Started (based on Weeks 1-2) Topics: Stack and Queue application Due: Week 3 Friday before midnight Total: 42 points. Your score is: Your Name: Date Submitted: 9/15/2017 --------------------------------------------------------------------------------------------- Purpose: To be able to choose the correct data structure for each problem. -------------------------------------------------------------------------------------------- For all HW: Must test your program on empress with g++. YOU MUST answer the State of the Program questions honestly or you will lose points. They will help us debug your program. Q0) Initial State of the Program Statement [4pts]: 1. 1. Does your stack class compile without errors? If not, describe. <Yes> 2. 2. Does it run with stacktest.cpp without errors? <Yes> 3. 3. Does your queue class compile without errors? If not, describe. <Yes> 4. 4. Does it run with queuetestp.cpp without errors? <Yes> Problem 1: Write a stack application program to evaluate post-fix expressions. [8+12=20pts] Your score is: Must use my stack.h, stack.cpp, client1.cpp templates. Run my solution program first to study the output. The user will enter a post-fix expression of the form 34+ which means 3+4 345+* which means 3*(4+5) 722+- which means 7-(2+2) as a string. Operators are +, -, and *. Single digit numbers only. No blanks.
Background image of page 1

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

View Full Document Right Arrow Icon
Please note that the expression could be wrong. e.g. 3+ - too few operands (i.e. cannot pop operand) 345 - incomplete expression (i.e. more than the result at the end) Your program will display the evaluated result (a number) or an error message describing what is wrong (the algorithm is in Notes- 1, so use it as given).
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}