Troy Johnson

Greenhorn
+ Follow
since Sep 24, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Troy Johnson

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 ]
16 years ago
Hello again. I am having trouble figuring out how to print and display the output of my code. I am trying to display the information when the program runs in the following manor:
Team 1 is up to bat:
Jason Crisp (average = 300.0) is out.
Rusty Johnson (average = 170.0) gets a hit.
Team 2 is up to bat:
Kevin McArthur (average = 375.0) is out.
Jason Harpham (average = 210.0) is out.
Could anyone offer any other suggestions or insight to what I am doing wrong. Thanks again.
Here is my code:
16 years ago
Hello. Thanks for your help everyone. I was able to run the program without any error messages. However, I dont have anything printing or displaying on the screen. Am I doing something wrong. I am trying to get the program to display the player information as such: Tom Smith (average = 400.0) is out or Tom Smith (average = 400.0) gets a hit. Any other suggestions. Thanks again.
16 years ago
Hello. I made the changes you suggested. I ran the program and got the following error message this time: Exception in thread "main"java.lang.ArithmeticException:/by zero at Player1.main<Player1.java:62>
16 years ago
Hello. When I try to run my program I get the following error message "Exception in thread "main"java.lang.NoSuchMethodError:main
My program will compile fine, but will display this message when I try to run it. However, when I try other programs they run fine. Does anyone have any suggestions or ideas. Thanks.
Here is my code

[ November 03, 2003: Message edited by: Troy Johnson ]
16 years ago
Hello. I am trying the following modifications to the problem.
1) Make all data members private.
2) Create appropriate get and set methods.
3) Write a test program that creates an array of 10 Planets.
4) Use "for" loops to fill the array, set the number of moons and rings for each planet.
However, I seem to be having a few problems getting everything figured out. Could anyone offer any suggestions or ideas to assist me. I seem to be a little confused. Thanks.
Here is the original code;

Here are the modifications that I have made:
16 years ago
Hello. I am trying to fill this entire array with new data objects using "for" loops adn then set the value of each objects variable i in the array by calling each objects setl() method. I am a little confused and lost about trying to add these modifications. Could anyone offer any suggestions or ideas. Again, I am new to Java and I greatly appreciate everyones help. Thanks.
Here is my code so far
16 years ago
Thanks everyone for all of your help. I greatly appreciate it. I think I finally got it figured out now. Thanks again.
16 years ago
Hello. I still seem to be struggling a bit getting this to work properly. I have made some modifications based upon previous suggestions and responses. I am tyring to modify the code by adding two additional constructors, one that takes the "annual interest rate" and "loan amount", and one that takes just the "loan amount". I need to use the keyword "this" to invoke new constructor. I am also to write a test program to test all constructors. Here is my original code and the modifications I have made. Please let me know if anyone has any suggestions or can help. Sorry, for the repetitive posts. I am new to Java. Thanks.

Here is my original code:

Here is the modification and solution I have so far

[ October 22, 2003: Message edited by: Troy Johnson ]
16 years ago
Thanks alot for your help Michael. The only other thing is that I need to invoke another constructor using the keyword "this". Sorry, I should have stated that at the beginning of my posting. I appreciate your helping me. Thanks.
16 years ago
Hello again. I still cant seem to quite get this modification figured out and was looking for some more help. I am attempting to add two additional constructors, one that takes the "annual interest rate" and "loan amount" and another that just takes the "loan amount" only. However, I seem to be stuck along the way trying to add these two constructors. Please let me know if you have or more suggestions. Thanks again for the help.
Here is my original code:

Here is my code with the modifications I have so far trying to add the two new constructors.
16 years ago
Hello. I am trying to add two additional constructors, one that takes "the annual interest rate" and "loan amount", and another that takes just the "loan amount" only. I am just a little confused on this and looking for any suggestions. Thanks.

[ October 19, 2003: Message edited by: Troy Johnson ]
16 years ago
Michael, thanks for your help. I guess I am still a little unclear on running an argument to that code? Thanks.
16 years ago
Hello. Thanks for everyones assistance on this problem. Again, I am working on making two modifications to the program. The first is to Ignore cases, which I have successfully completed. The second is to Use a command-line argument. I have utilized suggestions on using the command-line argument into the program and have implemented them into my program. My program compiles, but I get the following error message when I run the application: Exception in thread "main" java.lang.NoSuchMethodError: main. Could anyone offer any more suggestions or insight on this. Thanks.
Here is my code before using the command-line argument:

Here is my code after using a command-line argument, which I get the NoSuchError method when trying to run the application.

[ October 12, 2003: Message edited by: Troy Johnson ]
[ October 12, 2003: Message edited by: Troy Johnson ]
16 years ago
Hello. I am working on the following Java problem. I am making two modifications to the program. The first is to Ignore cases, which I have completed. The second is to Use a command-line argument. Could anyone offer any suggestions on using a command-line argument with this program. Thanks.

[ October 11, 2003: Message edited by: Troy Johnson ]
[ October 11, 2003: Message edited by: Troy Johnson ]
16 years ago