stack program

Anonymous
timer Asked: Nov 12th, 2016

Question description

This is a three part project:

  1. Implement the stack interface that I have attached as both a dynamic size array and as a linked list.
  2. Implement functions to convert one type of notation to any other type (eg infix to prefix).
  3. Implement an expression evaluation function.

You should write a driver program called 'XFixDriver.java' which prompts the user for the type of notation that he would like to enter, followed by the notation he would like to to convert to.

Particulars

Possible Conversions

There are six possible user requests:

  1. infix to postfix
  2. infix to prefix
  3. prefix to infix
  4. prefix to postfix
  5. postfix to infix
  6. postfix to prefix

Note: Implement all of these as separate functions. Don't use intermediate conversions.

Variables

All variables should be single chars A-Z or a-z. If anything else is processed, then the expression is illegal and you should report it as such.

Operators

The only operators that you should process: +,-,*,/,^

Any other operator found should cause an illegal expression to be reported.

Parens and Brackets

You are expected to process infix notations that have (),[],{} groupings. If you encounter any kind of missmatch, then you should report the illegal expression.

Driver

What type of expression would you like to enter:

1) Infix

2) Postfix

3) Prefix

0) Quit

Enter expression:

What would you like to do:

1) Convert to infix

2) Convert to prefix

3) Convert to postfix

4) Evaluate Expression

5) Return to Main Menue

0) Quit

Test Cases

As with all our projects, you are expected to generate your own test cases. Think about all the possible edge cases. Consider mismatched parens or brackets, invalid operators and invalid variable names.


Tutor Answer

(Top Tutor) Studypool Tutor
School: University of Maryland
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors