| 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: 965
|
|
|
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: 965
|
|
That is not a good example for someone learning java. Standard "if" statements are a better way for people starting out.
|
 |
 |
|
|
subject: Another question printing output
|
|
|