Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading sequence of characters in Java-----HELP!!!

807599Feb 10 2007 — edited Feb 11 2007
I need help with this program here..Im new to Java and struggling to get this to work..here's the problem..
The program monitors a possibly infinite stream of characters from the keyboard (standard input). If it detects the sequence "www" it outputs a "0". If it detects the sequence "wow" it outputs a "1". DO NOT detect sequences within sequences. The program should exit cleanly when it detects an End Of Input. For example:

The following sequence wwowowwwowww<End Of Input> would produce the following result: 100
While the following sequence wwwowowwwwoowowow<End Of Input> would produce the following result: 0101
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2007
Added on Feb 10 2007
6 comments
342 views