Closed

# Need a good Java Programmer

This project received 30 bids from talented freelancers with an average bid price of \$320 USD.

\$250 - \$750 USD
30
###### Project Description

Hi,

I need a honest person who can write me a java programming assignment.

The instruction is as following:

"General statement

In this lab you will be asked to write a simple interpreter for arithmetical expression evaluation using stacks. According to wikipedia, expression is a finite combination of a symbols of a known context. It is possible to write the same arithmetical expression in different forms.

In the infix notation, we write

operand1 operation operand2

Example:

( 1 + ( ( 2 + 3 ) / 5 ) ) * -4

In the postfix notation, we write

operand1 operand2 operation

Example:

1 2 3 + 5 / + -4 *

Also there exists prefix notation where we write

operation operand1 operand2

Example:

* + / + 2 3 5 1 -4

You might find this algorithm useful in solving this problem.

Assignment

Given a String in the infix notation , find its postfix notation and evaluate it. Conversely, given a String in the postfix notation find its infix one and evaluate it. Expressions to be evaluated might include the following operations:

+,-,*,/,^

As well as brackets:

(, )

Numbers in the expressions can be only integers ( negative, 0 , positive).

Extra-credit (+10)

Implement expression evaluation for vectors. Expression might only include the following operations:

a) numbers operations

+,-,*,/,^

b) vector operations

+,-

c) brackets ( for both, numbers and vectors )

(, )

d) vectors will be denoted as ( square brackets mean start of the vector, they are not brackets used to change precedence of the operations; comma denotes another vector component )

[ x1 , x2 , ... , xn ]

Sample input:

[ 1 , ( 3 - 4 ) ] - ( [ -2 , ( 7 - 8 ) * 2 ] + [ 0 , 4 / 2 ] )

Output:

//postfix

[1 , 3 4 - ] [ - 2 , 7 8 - 2 * ] [ 0 , 4 2 / ] + -

//evaluation

[ 3 , -1 ]

Implementation

Implement the class Expression and functions infixToPostfix(), postfixToInfix(), evaluate(). More specifically, implement the following:

public class Expression{

public Expression(String inputExpression, String inputNotation){

}

public static Expression infixToPostfix(Expression expression){

//get expresion exp in the postfix notation ( you have to use stack for it)

}

public static Expression postfixToInfix(Expression expression){

// get expression exp in the infix notation

}

public static String evaluate(Expression expression){

//using stack evaluate Expression expression based on the notation

}

}