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 Puzzled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Puzzled" Watch "Puzzled" New topic
Author

Puzzled

Iain Palmer
Ranch Hand

Joined: Jul 28, 2004
Posts: 56
I'm writing the assignment Java-4(Say) and I can't get the correct output for nos 11-19, I've got all the rerst to print-out correctly but everytime i try to get 11-19 to printout I can't I've tried an if statement, an if-else statement,a while statemnt and a do-while statment and am running out of ideas. I haven't used a for loop because it doesn't have to loop round
Iain Palmer
Ranch Hand

Joined: Jul 28, 2004
Posts: 56
Don't Worry I was using wrong operators, I've sorted it out now
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Post your code using CODE tags and expected output and we can have a look

EDIT: OK...
[ March 29, 2005: Message edited by: Kashif Riaz ]
Iain Palmer
Ranch Hand

Joined: Jul 28, 2004
Posts: 56
Here' s the program I am using JOptionPane to get the input because I'm using either NetBeans or JCreator
Iain Palmer
Ranch Hand

Joined: Jul 28, 2004
Posts: 56
I got it wrong. The output is fine if I take out the System.exit(0) for the If statment but if i enter 12 I get
Twelve
Ten
Two
Kareem Qureshi
Ranch Hand

Joined: Mar 14, 2002
Posts: 102
I think your if condition is wrong
it should be if (no >10 && no <20 ) instead of if (no >10 || no >20 )

Hope this helps
Thanks
Kareem
[ March 29, 2005: Message edited by: Kareem Qureshi ]
Iain Palmer
Ranch Hand

Joined: Jul 28, 2004
Posts: 56
Thank you it works I thoght it had to be something simple but I just couldn't see. Sorry for the late reply but have been busy.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Puzzled
 
Similar Threads
Question about loops and help
Swimming competition score program
do while loop problem
Time out inside a servlet
from JLS