Sam Pauken

Ranch Hand
+ Follow
since Jun 03, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Pauken

I do not have access to that book. Is there another way I could be guided through the process?
10 years ago
Given how things have been historically, when we aren't given direction on something, we are free to solve the problem in whatever way seems best to us. We have written our own algorithms and have used Collections.sort() in the past. Basically, I need to figure out the easiest solution to the problem, but I'm an unsure how to think it through correctly.
10 years ago
We aren't given direction either way.
10 years ago
I changed my sort method, but it still doesn't work of course. How can I think this through. I understand what you guys are saying, and I'm going through the APIs you linked, but I'm not sure how to wrap my head around this. Basically, what I know I need to do is:

1. Iterate through the list
2. As I go through the list check to see if n2 is greater than or less than n1 and adjust their placement accordingly.
3. Keep doing this until I get to the end.

So I'm not sure whether I should use Collections.sort(), or if I should use some other method. Maybe there's a way to apply this.

10 years ago
Thanks. For the reverse, per our instructions, we only have to print it in reverse, we don't actually need to reverse the whole list.

Could you give me an example of how my reverse() method my look if it had a return. We've been using plenty of void methods in my class and plenty of non-void ones, so this is a design idea that I'm unfamiliar with.
10 years ago
I'm having some trouble creating a map for my program below. Below it is an example of what I'm referring to, but there we had an input instead of reading in a text file. How can apply it to what I'm trying to do here.


10 years ago
For the code below, I'm trying to sort my data, but the final data piece isn't being capture in my sort method. How can I fix this?

10 years ago
I am trying to prime this data so I can read it into a serializable file, however I can't get this to prime correctly. Below is the method and my method call.



10 years ago
They are in a text file. I have readText and writeText methods written. Is what I've written not getting me to what I want to do?

I've also written this as an alternative.

10 years ago
Here's what I have now. I don't know if I'm using the delimiter correctly or not. I also haven't been able to get the "s" into my print statement either. I'm pretty sure I should be able to remove the .split(",") from my print statement and I'm also pretty sure I won't need the private method at the end, but here's what I've got so far. What does everyone think?

>
10 years ago
Thanks for all the responses. Just to clarify what I'm trying to do. I have n lines of data, each which are KNOWN to be seven piece of data long. I want to get data piece number 1 from each line, then piece 2, etc. until I reach data piece number 7. Here is what I have now. (I'm cramming this in during my lunch break at work so I haven't been able to test this yet.)

>
10 years ago
Jeanne, I have a text file (I've already imported the data), and I'm trying to get 1245.67,2541.36, and 2513.45, the first number from each line until I reach the end. This was not originally a String.
10 years ago
I'm trying to print out each piece from the txt file (data below). In my print method, I have it set to divide by three to get the average, but I'm not sure how to get the first number from each line down the line. I have the below, but something tells me I'm off the mark.



1245.67,1490.07,1679.87,2371.46,1783.92,1461.99,2059.77
2541.36,2965.88,1965.32,1845.23,7021.11,9652.74,1469.36
2513.45,1963.22,1568.35,1966.35,1893.25,1025.36,1128.36
10 years ago
I am going to read those. I was just wondering if there was a different way to do it.
10 years ago
Yes, I'd just like to print each last name to the console. If I can do this a completely different way if there's any easier way to do this. I do not need to do it the way I'm doing. Please let me know if there's any easier way to do this.
10 years ago