Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solving this. I need to do 3 file : stlInfixPostfix.cpp, decimalBinaryStacks.pdf, and decimalBinaryStacks.cpp How to use stacks in applications Evaluate a postfix

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribedPlease help me solving this. I need to do 3 file : stlInfixPostfix.cpp, decimalBinaryStacks.pdf, and decimalBinaryStacks.cpp
How to use stacks in applications Evaluate a postfix expression Convert from decimal to binary using stacks o Coding exercise 1 - Write a program to evaluate a postfix expression Extend your code in stlInfixPostfix.cpp Lab 5 to convert expression that contain numbers in place of variable names (e.g., in place of A B C, the expression may be 2 10 5) from infix to postfix. Hint: Beware of the spaces in the expression. Include a function in stlInfixPostfix.cpp with signature double evaluatePostFix(string expression) that evaluates an expression provided in postfix format. You may refer to the textbook or the lecture slides for the algorithm. E.g., 2 10 5 should be evaluated to 52 using your algorithm. Optional extensions: Enable expressions with non-integer and negative numbers. Include operations ++,--, and % . Coding exercise 2 -Convert a decimal number to binary using stacks In this exercise, you are required to think of an implementation to convert a decimal number to binary (output as a string). We discussed the iterative algorithm and recursive algorithm in class. Write the pseudocode of your algorithm in a file called decimalBinaryStacks.pdf. In the same file explain your thinking and references you used. Implement your pseudocode in a file called decimalBinaryStacks.cpp. The code should take an integer as the input decimal number, and the output should either be a string, or output the binary number using cout. You may use the STL stack or your own implementation of stacks. What to turn in A zip file containing stlInfixPostfix.cpp, decimalBinaryStacks.pdf, and decimalBinaryStacks.cpp. Your zip file should be named StacksApplications XXXyYxxx.zip, where Xxxyyxxx is your SJSU ID. E.g., if your SJSU ID is 111000111, your submission will be called StacksApplications_111000111.zip. When to turn in How to use stacks in applications Evaluate a postfix expression Convert from decimal to binary using stacks o Coding exercise 1 - Write a program to evaluate a postfix expression Extend your code in stlInfixPostfix.cpp Lab 5 to convert expression that contain numbers in place of variable names (e.g., in place of A B C, the expression may be 2 10 5) from infix to postfix. Hint: Beware of the spaces in the expression. Include a function in stlInfixPostfix.cpp with signature double evaluatePostFix(string expression) that evaluates an expression provided in postfix format. You may refer to the textbook or the lecture slides for the algorithm. E.g., 2 10 5 should be evaluated to 52 using your algorithm. Optional extensions: Enable expressions with non-integer and negative numbers. Include operations ++,--, and % . Coding exercise 2 -Convert a decimal number to binary using stacks In this exercise, you are required to think of an implementation to convert a decimal number to binary (output as a string). We discussed the iterative algorithm and recursive algorithm in class. Write the pseudocode of your algorithm in a file called decimalBinaryStacks.pdf. In the same file explain your thinking and references you used. Implement your pseudocode in a file called decimalBinaryStacks.cpp. The code should take an integer as the input decimal number, and the output should either be a string, or output the binary number using cout. You may use the STL stack or your own implementation of stacks. What to turn in A zip file containing stlInfixPostfix.cpp, decimalBinaryStacks.pdf, and decimalBinaryStacks.cpp. Your zip file should be named StacksApplications XXXyYxxx.zip, where Xxxyyxxx is your SJSU ID. E.g., if your SJSU ID is 111000111, your submission will be called StacksApplications_111000111.zip. When to turn in

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago