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

Info icon This 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.
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).
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern