Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

G. Graz

Ranch Hand
+ Follow
since Oct 23, 2006
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 G. Graz

OK, great ! Thank you so much !
12 years ago
Is it possible to pass Boolean method as a parameter of another Boolean methods “if” statement ?. Basically I want to have a “if” statement execute if the parameter ( in this case the other Boolean method) is true. Something to this effect :
12 years ago
Hello , I am working on a reverse method that will reverse the objects of the Doubly LinkedList via the pointers . To accomplish this I have to use "next" & "previous" . I am confident that I am on the right track with my method but would like a second set of eyes. All I am really looking for is a thumbs up or down on the my logic behind it , what I am doing is drawing an actual linklist on a whiteboard and running this method manual . Thank you for any suggestions. And yes , I know this can be accomplished much easier but the goal is to have a better understanding of object reference .





12 years ago
The program below takes values entered by the user and stores them into a HashMap . I am specifically having issues with option #3 " Retrieve an Employee" . All my data gets entered into the HashMap correctly , but I run option #3 I will get an incorrect result ? from the output the data displayed is the last input form the user ? When I debug the program the "value" in the map is correct with what was entered.......so if my "values" are correct and I am using the "containsvale" method , why is my result returning the last value entered by the user ? Thank you for any suggestions !

12 years ago
Ok, I have reworked the code. Problem I am having is that I can not find enough info anywhere on nested "try" blocks. So again when I run each loop on it own everything works. When I try to nest them in a try block , I will get the second loop to kind of work but never the first. Can anyone see the issue that i am having and provide me with some insight to my incorrect nesting of the try block. Thank you.

>
13 years ago
The following program reads input from a .txt file and prints out the text all in lowercase and then prints out the frequency of the letters used. The problem that I am having is I can get my "try" block to work when the "for loop" is not there and same with the "for loop"...works when I remove the "try" block ? Program does what I want it to do , I just can not get the everything to work as one ? Thank you for any suggestions in advance.

>
13 years ago
I am trying to count and store the frequency each letter occurs form a .txt file . I am at the point where I can read back the file but I can not get any methods to work that would count the frequency of a letter in that file .


Simple ..no problems but here is some code that I think works in regard to counting the frequency but I am missing something to get it to function correctly ? Any ideas please let me know ! Thank you .



Again something where I think it would work but just do not see the error ?



So basically , I need to read a .txt file and print out that the character 'A' appeared x number of times .

Thank you again !
13 years ago
OK, got your attention ! I have a question for all the JavaRanchers . I am looking for a java book that does not teach me java but rather gives me problems to solve and then after I think I have the solution I can look at what the author had as the coding solution. Is that what a cookbook is ? and or is there anything out in publication or on the web that does something close to what I am looking for? I know java , but I am looking to advance my programming skills past the basics . Thank you for any help into this question.

13 years ago
I am getting an "java.lang.ArrayIndexOutOfBoundsException" error in the code below I think it might be at sum = average[i]; but I do not see why I am throwing that error ? The array element has an index of 16 , reading off a .txt file . Ok, please let me know if you can see what I am doing incorrectly ? Thank you.


13 years ago
From the .txt file I created two Arrays , “Text” & “Int” array. So, I am now in my Comparator class , I want to bind each index of the arrays that I created with something like :

Student[0] = new student();
Student{Text.size[i]].setScore ( Text[i]);
Student[Int.size[i]].setName(Int[i]);

I know I need to create some type of loop that gets and sets what I want to use the Comparator on, and the above example is probably way off but my question is , “Can this be done “ ? My .txt file has no set amount of data so I have to use some type of generic so my ArrayList is populated with what is given in the .txt file . I will post my code if I am not getting my question across correctly. Thank you.
13 years ago
Ok, will do ! my Logic was half there ! Thank you !
13 years ago
I need to bounce an idea off someone to see if I am heading down the right direction with how I want to write a program. I need to read a .txt file , the file will have lines of data with each line containing the following :
student grade, student name , student ID . The .txt file has no set length so I am gong to use an ArrayList to store the data , problem that I am having is when I recover the data it's all in one array.

ex. [ 100, bob, 55555, 96, tim, 12345, 87, amy, 54321 ]

I need to break the ArrayList down so I can use the Collections.sort to sort the array date by name . so the result would look like:

amy 87 54321
bob 100 55555
tim 96 12345

This is where I need the help ...I was thinking about using a for loop to sort the data out , then apply the Collections.sort to it after my loop is complete. Would using a "For Loop" be going in the right directions with this ? Thank you for the help !
13 years ago
ok, thank you ! I got it ! I was a bit confused by the API when I first looked at it . Thank you again.
13 years ago
I am bit confused on a part of code that I am working on. I am grabbing ArrayList data and then putting it into an Array to compute the average value of that Array , I keep on getting the following error message " Operator cannot be applied to double, java.lang.object" during my sum += average[i], Anyway the way I have the loop structured should be correct , I do not know what I am missing to cause the error ? Any ideas ? Thank you.

13 years ago
Bingo !!! So simple and I did not even see it ! Thank you again for the extra set of eyes !
13 years ago