This discussion is archived
1 Reply Latest reply: Nov 19, 2012 4:43 PM by jschellSomeoneStoleMyAlias RSS

help in java

974681 Newbie
Currently Being Moderated
hey,
I am asked to write a program in java that gets a line from the user (string) with real numbers (double) and arithmetic operations and (it might contain spaces) calculates the sum.
for example:
please enter your expression:
10.22 -2.22 +3.0

output:
10.22 -2.22 +3.0=11.0

well, i thought about using split() with a regular expression but I don't find a suitable one.
would you help me please?
thanks,
Jenny

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points