File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Need help please!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Need help please!!

Rose Evans
Ranch Hand

Joined: Oct 14, 2004
Posts: 195
Ok you smart java guys. You helped me so well with my last problem, I have another question to ask you.
I am trying to write a program like this..

if the sentence ends with an even number of characters
and a question mark, it will output the word 'Yes'.
If the sentence ends with a question mark and it is an
odd number of characters, it will output the word 'No'.
If the sentence ends with an exclamation mark, the output
will say 'Wow!'. In all other cases, it will output
'You always say that.'

I almost have it written, but I cannot figure out a way to make it 'stop' when I want it to. Like, after it answers a question and says yes, I want it to stop, right now after it answers the question, it also displays the 'Wow" and 'You always say that' also.
Also, it is answering yes when I put a period at the end of the sentence and if a period is at the end of the sentence it should just say, 'you always say that'.

Any suggestions. I'd appreciate your help.



) ) ) )
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Rose, this is the third time you posted a question that was NOT a servlets question in the servlets forum.

The last two, I was nice to move for you to the correct forum, Java In General (Beginner). For this one, I am just going to close it and let you post it in the correct forum.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need help please!!