Expert answer:Infix to Postfix Conversion and The Evaluations of

Expert answer:You are to design and implement and algorithm in Java, to input an Infix expression , convert to a postfix expression and finally evaluate the postfix expressionplease see the attachment for more info about the assignment
csc241programming_2.docx

Unformatted Attachment Preview

Programming Assignment 2 – RPN Calculator –
Infix to Postfix Conversion and The Evaluations of the Postfix Expression.
You are to design and implement and algorithm in Java, to input an Infix expression , convert
to a postfix expression and finally evaluate the postfix expression… Follow the examples done
during class lectures…
Problem description:
1. We are used to infix notation – ”3 + 4” – where the operator is between the operands.
There is also prefix notation, where the operand comes before the operands. A
Reverse Polish Notation calculator uses postfix notation, and was one of the first
handheld calculators built. At first, it seems confusing, but is very logical once you
think about it. Instead of doing ”2 + 3 + 4”, you may do ”2 [enter] 3 [enter] 4 [enter] +
+”.
2. You will be implementing a conversion from infix to RPN and then perform an RPN
calculator for this assignment.
3. How does an RPN calculator work? It is quite simple in principle. The calculator keeps a
stack – a list of numbers. When you type a number and hit ”enter”, it pushes, or
appends the number to the stack. So you build up a stack of numbers. Whenever you
click an operand, it applies the operator to the top of the stack. In the previous
example, it builds a stack like [2, 3, 4]. When you hit the first ”+”, it pops off the
top/most recent two elements off the list and ”pluses” them. Lastly, it pushes the
result back on the stack, so it looks like [2, 7]. When you hit plus again, it pops off the
two elements (so the stack is temporarily empty), adds them, and pushes it back on
the stack, so you get [9] .
3 What you need to do
For the first part of this assignment, think about what classes you need. Java has a Stack
class for you, but write your own ( do nt use the Java Stack class). Use encapsulation, think
about what methods it should have, and call it something like CalculatorStack. Add an
option to ”roll” the stack; shift it left or right by one (and the end number rollls) to the
other end). Other classes may include Controller, Handler, or SpecialOperationsHandler.
4 Why?
• It’s one of the better assignments I can think of as a teaching tool
• RPN calculators are awesome – they’re far more logical than infix calculators once
you get used to them
• You should learn RPN calculators; besides the historical importance, it forces you to
think differently. Several example done during class lectures.
The following code below is a sample on how to evaluate the RPN expression …

Purchase answer to see full
attachment

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP