aspose file tools*
The moose likes Beginning Java and the fly likes Another question printing output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Another question printing output" Watch "Another question printing output" New topic
Author

Another question printing output

Troy Johnson
Greenhorn

Joined: Sep 24, 2003
Posts: 20
Hello. I just about have this program figured out. However, I am still having a problem getting the display to print out just right. I am pretty close. I am not sure how to add a text statemenet ("is safe") to true and ("is out") to false. Could anyone offer any suggestions or insight. Thanks again.
Here is how I am trying to get the display to look when the program runs:
Team 1 is up to bat:
Jason Crisp (average = 300.0) is out.
Rusty Johnson (average = 170.0) is safe.
Team 2 is up to bat:
Jason Harpham (average = 210.0) is safe.
Kevin McArthur (average = 375.0) is out.
Here is my code:

[ November 05, 2003: Message edited by: Troy Johnson ]
[ November 05, 2003: Message edited by: Troy Johnson ]
[ November 05, 2003: Message edited by: Troy Johnson ]
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

You don't want to print out the retrun from isSafe. You want to use the return from isSafe in an "if" to determine what to print.


Please ignore post, I have no idea what I am talking about.
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
Look at the ternary operator in Java. It's a condensed version of an if-else statement.


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

That is not a good example for someone learning java. Standard "if" statements are a better way for people starting out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another question printing output