File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes fast food service program. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "fast food service program." Watch "fast food service program." New topic
Author

fast food service program.

ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
hello again.
im trying to modify some code that has been provided to me.
i am having trouble in a few areas.
1.) when using a read utility, how can i accept any instance of the word "yes?" "yes," "YES," "YeS," etc.
2.) when using a loop, how can i call on each individual value in a string to display one after another?

this is what should be displayed.


this is what i have, how can i get this to display like that? all i want to do is call on each element, i know how i can call each individual element, but what code do i use so that i can continually call them all until there are no more to call. please pay no attention to the utility call.


i would appreciate any input you could provide.
thank you very much.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by ken zemaitis:
...1.) when using a read utility, how can i accept any instance of the word "yes?" "yes," "YES," "YeS," etc.

One way is to use String's toLowerCase method to standardize user input, then compare it to a lowercase String. For example...

boolean isYes = usersInput.toLowerCase().equals("yes");
Originally posted by ken zemaitis:
2.) when using a loop, how can i call on each individual value in a string to display one after another?...

It looks like you already have your Strings in the array, so you reference them by index. Within the loop, this is just items[ i ]; (I think this is what you're asking.)


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
ken zemaitis
Ranch Hand

Joined: Sep 26, 2005
Posts: 42
Originally posted by marc weber:

It looks like you already have your Strings in the array, so you reference them by index. Within the loop, this is just items[ i ]; (I think this is what you're asking.)


that is what i had originally figured, but i wasnt sure. thank you for your help, saves me hours of headaches.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fast food service program.