Narresh K.

asked • 11/26/15

if there is no brackets at all the expression is as follow 4+3*2 that means what would be the answer

need answer with complete clarity
answer is 14 or 10

Rose H.

I find this annoying when there are no parenthesis, because when one reads words they don't search ahead in the words for new instructions so why does this have to be in math? On an episode in M*A*S*H they read instructions about diffusing a bomb. It read like, "Cut the main wire" which they did, next it said but First, unscrew something else. So much for clarity of standards.
 
Report

08/16/18

David W.

tutor
But, wait !
 
 
The instructions you mentioned from M*A*S*H were written, NOT A MATH FORMULA.    [so, why are you complaining about math?]
 
A math expression such as  4+3*2  has a very clear evaluation process.  In a computer, it happens in the Scanner:
      Found a "4"; it is a number (or a variable)
      Found a "+"; it is an operator (also, the number 4 is completed because the + acts as a delimiter)
      Found a "3"; it is a number (or a variable)
      Found a "*"; it is an operator
      Found a "2"; it is a number (or a variable)
      Found the end of the expression
 
The expression looks like this (as a tree structure):
                          +
                       /     \
                      4       *
                             /   \
                            3     2
 
Now, scanning the tree in PostFix order, the expression becomes:      4 3 2 * +
 
Such an expression does not use parenthesis (there is no need for them).
 
To evaluate:
    (1)  While there are more tokens in the expression
       (2)  Select the next token
       (2)  If it is a number (or a variable), PUSH it onto the stack
       (3)  it is a binary operation (two operands),  POP the two tokens from the stack, perform the operation, then PUSH the result onto the stack
   ( 1)  end while 
  You have the value of the expression (note: ready to be used or else stored by an assignment statement).
 
PLZ don't be annoyed at math (or computers) -- many people have worked very hard to make then unambiguous !!
 
Report

08/16/18

2 Answers By Expert Tutors

By:

David W. answered • 11/26/15

Tutor
4.7 (63)

retired

Ceri Leanne D.

5 ÷ 5 = 1, 1 x 2 = 2, 9 - 2 = 7, 7 + 6 = 13 Thank You :D
Report

05/07/19

Sharon K.

What is the answer to this problem: 50+50-25x0+2+2
Report

07/21/21

Sharon K.

50+50-25x0+2+2
Report

07/21/21

David W.

tutor
First, do the multiply, so, 50 + 50 - 0 + 2 + 2
Report

07/21/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.