Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Norm Radder

Master Rancher
+ Follow
since Aug 10, 2005
Worked mostly with IBM mainframe assembly code. Loved IBM's VM OS.
On vacation
Cows and Likes
Cows
Total received
35
In last 30 days
1
Total given
1
Likes
Total received
394
Received in last 30 days
7
Total given
73
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Norm Radder

Can you post your code (wrapped in code tags) so we can see what it is doing?
9 hours ago
Another idea instead of using threads, is to do the movements at fixed time steps.  Each person would have a flag that determined at what time step they were to make a move.  So at each time step some people would move and some not.
Sort of like how the Game of life runs.
Does the code do what you want?  
Do you have any specific questions?
10 hours ago

formula of the calculation code is good or not?


It is time to take a piece of paper and a pencil and work through the formula manually and then compare that to what the computer gives.

One thing that is missing is the logic for this:


(not in the list)
. .
. ...until you find the first n in the list below.

10 hours ago

it doesn't change anything


Strange.  If all the items in the array were shifted to a higher index location by adding an item at position 0, that should have changed what was at the computed index.
10 hours ago
One easy way to shift the indexes is to add a item at the first slot (position 0) in the array.
11 hours ago

the output must be apple


What index(es) does the apple String have?  Do  any of the input values of n create one of those indexes?
12 hours ago

it doesn't work yet


Please explain what that means.  What happens when the code is compiled and executed?

Where is the main  method and the code that calls the subtractSum method?

Note: The code on line 108 changes the value of n that was passed to the method.
12 hours ago

we have to make a hastmap,


A String array might be easier to use than a Map.
14 hours ago
One comment about the code: line 4 replaces  the value in n that was passed to the method.  

Remove line 4 to have the code work with the value passed to the method.
14 hours ago
Sorry, You haven't given us enough detail.  Please explain what and where and when etc
Be sure to wrap all posted code in code tags.
1 day ago
Do you know what row(s) and column(s) the desire  values are in?  Does the ResultSet class have methods to access the contents of the columns?

I do not know anything about how to use databases so maybe someone else here can give you better answers.
1 day ago
Ok,  is your question about how to receive the desired data from the SQL query response so it can be assigned to the designated variables?
1 day ago
If you want values other than 0, change the contents of the variables.  For example:
1 day ago
What is the setUpGame() method supposed to do?  
Does it change the values any any variables that are defined at the class level? That is that are defined outside of the method.
Print out the contents of the variables that it changes before it is callled.
Then print out the contents of the variables after it is called.
Look at those two print outs and see if the method made the expected changes.
1 day ago