Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

application to parse a command line string and evaluate it.

 
Randy Helene
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a java application to parse a command line string such as java ParseEval 3.5 - 7.0 + 8.1. Only + and - operations are allowed. The string can contain spaces. I am at the point where I can find the position of the + or minus signs, but I am having trouble putting the numbers to be evaluated into a statement that can be evaluated. Can anyone help me with this? I am pretty new to java programming.
 
gautam shah
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


uses:- java Eval 3 - 5 + 8 - 1 + 23 - 45
(edited by Cindy to shorten the display width)
[ April 16, 2002: Message edited by: Cindy Glass ]
 
Randy Helene
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic