C++ project stack temp expression evaluator

Completed Posted Aug 1, 2015 Paid on delivery
Completed Paid on delivery

Need help with stack template project for C++ please . Please read in the input from the [url removed, login to view] below and send correct code by the directions with the correct screenshot output. The [url removed, login to view] is in the dropbox link below. The input file uses parenthesis and the code should act off when it hits the right parenthesis. Please implement the parenthesis in the code. THe output should look like the example output below please send screenshot of code output. Need this done within 24 hours thank you

[url removed, login to view]

For this program, we'll be writing a simple expression evaluator that uses a stack [url removed, login to view] carry this out, 2 stacks are needed, 1 for numbers (ints) and the other for operators (chars). Thus, a template stack is needed. Input is a fully-parenthesized algebraic expression.

You are given an input file containing several expressions, some of them valid, some not. Output is to the screen; for each expression, either the value of the expression or an “invalid expression” message.

Development notes: • Write a template List class. The class should contain the following methods:

◦ push_back(item) ◦ push_front(item) ◦ insert(item) // assumes list is already sorted, places in order ◦ sort() ◦ size() ◦ clear() ◦ pop_front() // removes first item, returns nothing ◦ pop_back() // removes last item, returns nothing ◦ front() // returns first item, does not alter list ◦ back() // returns last item, does not alter list ◦ remove(item) // removes 1st occurrence found in list ◦ remove_all(item) // removes all occurrences in list ◦ is_present(item) const // returns true if item is anywhere in list, false otherwise

◦ As part of the List class, declare a ListException class that can be thrown on a list error (such as attempting to remove something from an empty list, etc) • The stack class will be a wrapper for the list class, exposing only a limited set of of this functionality: ◦ push(item), which calls push_back ◦ top(), which calls back() ◦ pop(), which calls pop_back() ◦ size(), clear(), and is_present() all call the corresponding list methods.

• As part of your stack class, define a StackException class that can be thrown on stack overflow or underflow. This can simply be a catch block that catches a ListException and throws a StackException as its action.

• Your program should print error messages for mismatched parentheses (at end of processing a right-parenthesis, the top character on the operator stack is anything other than the corresponding left parenthesis), invalid character in input, or “invalid expression” for anything else.

Example of input and final output should look like this:

Input ([url removed, login to view]):

(1 + 1)

((7+5)/2) (

(3*4)+ 1)

(1 + * 1)

((7+5)/2))

(((3*4)+ 1)

((7+5)/2 3)

((7$5)/2)

(((9+3)*((3+1)/(1+1)))/4)

Output (to screen):

2

6

13

Mismatched parentheses in expression. Invalid expression.

Stack error in Evaluate(): Stack error on item access Invalid expression.

Invalid expression.

Invalid expression.

Invalid character in input: $ Invalid expression.

6

C++ Programming Software Architecture Software Development

Project ID: #8186923

About the project

4 proposals Remote project Active Aug 1, 2015

Awarded to:

it2051229

Hi, I have read the requirements and I would like to do this project if given the opportunity. I am a computer science practitioner and having the "C++ and Algorithms Certification Badge" in my profile gives me confide More

$30 USD in 1 day
(416 Reviews)
6.6

4 freelancers are bidding on average $30 for this job

vahid01

hello. i can provide a perfect program for you in less than 12 hours. thank you.

$30 USD in 0 days
(33 Reviews)
5.2
pinetree800

Hi,sir. I am interested when saw your post. Before I have ever done such similar projects. I have lots of experience on the fields you want. My skill:Mathematics,Matlab,C,C++,Excel,Web scraping,MySQL,Website develo More

$30 USD in 1 day
(4 Reviews)
1.1
wenguo214

ok, very good please see my portfolio then you can know about my skill this project is in my skill i can provide you high quality under acceptable price price will depend on detail please check pm

$24 USD in 1 day
(0 Reviews)
0.0
gopiande

A proposal has not yet been provided

$30 USD in 2 days
(0 Reviews)
0.0