GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes application to parse a command line string and evaluate it. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "application to parse a command line string and evaluate it." Watch "application to parse a command line string and evaluate it." New topic
Author

application to parse a command line string and evaluate it.

Randy Helene
Greenhorn

Joined: Apr 16, 2002
Posts: 21
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

Joined: Oct 29, 2000
Posts: 72


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

Joined: Apr 16, 2002
Posts: 21
Thank you for your help.
 
GeeCON Prague 2014
 
subject: application to parse a command line string and evaluate it.