Results 21 to 25 of 25
Thread: Help with Delimiters/While loops
- 09-20-2012, 12:59 AM #21
Re: Help with Delimiters/While loops
Don't think about delimiters. Think about tokens. You want a class/method that understands tokens.switch between delimiters
If it is given: 8-3+4
it will return these 5 tokens: 8 & - & 3 & + & 4
Now look at the pseudo code in post#19.If you don't understand my response, don't ignore it, ask a question.
- 09-24-2012, 12:48 AM #22
Member
- Join Date
- Sep 2012
- Posts
- 19
- Rep Power
- 0
Re: Help with Delimiters/While loops
In the loop...could I write a case statement that uses the + and - as characters??update total using operator and number
Ex:
Java Code:switch(x) { case "-": total = total + number; break; case "+": total = total - number; break; }
- 09-24-2012, 02:34 AM #23
Re: Help with Delimiters/While loops
You can now use Strings in switch statements with Java 1.7
If you don't understand my response, don't ignore it, ask a question.
- 09-26-2012, 03:50 AM #24
Member
- Join Date
- Sep 2012
- Posts
- 19
- Rep Power
- 0
Re: Help with Delimiters/While loops
Thank you Norm! You helped me solve this problem! :D!
- 09-26-2012, 04:05 AM #25
Similar Threads
-
this code is not working I Dont know why ? Public void close the last code!!
By lukote04 in forum New To JavaReplies: 1Last Post: 03-25-2012, 02:40 AM -
I want the source code of DUK's Bank , the example code in Java EE 5 Tutorial 2010
By zahra in forum New To JavaReplies: 16Last Post: 01-31-2012, 08:36 PM -
servlet include method copying sorce code and executing source code as output how to
By shamkuma2k in forum Advanced JavaReplies: 0Last Post: 08-07-2011, 08:32 PM -
C server code - Java CLient Code _ TCP Connection Problem
By rmd22 in forum NetworkingReplies: 0Last Post: 02-21-2011, 11:50 AM -
Generating Code Automatically Using Custom code Template In Eclipse
By JavaForums in forum EclipseReplies: 1Last Post: 04-26-2007, 03:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks