Sammie Hassett

Greenhorn
+ Follow
since Apr 10, 2015
Merit badge: grant badges
For More
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
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sammie Hassett

Thank you all for your input, I am going to start over and try to put it in a map because that seams a little more simple than what I am currently trying to do.
8 years ago
I know that this should be easier than I am thinking it is, just for some reason I am confusing myself. Here do you think that what I have so far to get the top three is enough with adding the new variables or should I try to use a map? I haven't worked too much with lists, sets, or maps.
8 years ago
Hello, I need my code to print out the top three most common IP Addresses in the ArrayList. Right now I have it printing out the top IP Address. I am a little confused as to how to get it to print out three. Every time I change something, It doesn't give me the correct results. Any Suggestions?
My Code:

Thank you
8 years ago

Tushar Goel wrote:How are you trying to print them? Can you please show us?



Sure I have a test code:
8 years ago
To string Returns the last character doubled
How do i stop it from doubling the last number?
8 years ago
Ok so now I have to add it to a toString in the second part of my work,
I am having an error with how to return the toString
8 years ago

Mike. J. Thompson wrote:You print statement does not appear in your for-loop. This means that there will only ever be at-most one print statement executed. If you want to print out every digit then you need to move the print statement into the for-loop.

Are you sure it only prints digits that appear first though? It looks to me like the local variable 'c' will only ever contain the final character from the String.



Thank you so much, that fixed it..Yes i did come across that but now it seems to be working fine. I changed my code to
8 years ago
This is the code that I have so far, It will only print out the digit if it is entered first..How to I get it to print out all digits? and I am getting an error that the c is not initialized




thank you for your help
8 years ago

Junilu Lacar wrote:Pile of rocks ==> your array of letters

Bucket ==> a list that can hold any number of things

Pick a number, any number ==> generate a random number

Throw X rocks from the pile into that bucket => add (random number of whatever) from ? to ?

In your code:

You say that this always prints out the same length -- why do you think it does that? What is that length that's always the same right now? In your code, what controls how many times this loop executes? If you want to execute the loop X number of times, what do you change? If you want to execute X number of times where X is some arbitrary number what do you need to do?



Im not sure...Im just starting, and I dont fully understand the code in depth..Im just coding what ive been taught so far
8 years ago

Junilu Lacar wrote:So if I say "Pick a number, any number" and you pick a number. Then I say, "See that pile of rocks over there? Go over to that pile of rocks and throw as many rocks as that number you just picked in that bucket over there."

That's kind of what you have to do. Do you know how to add things to a List?



Yes i know how to add to a list but i am still confused as to what you mean??
8 years ago

Junilu Lacar wrote:Do you know how to generate a random number? That's where you want to start. Once you can generate a random number, the next step is to create a list with an arbitrary length by adding elements X number of times, where X is an arbitrary number.



I kind of know how to do a random number for example like


but even that prints out number of the same length and I dont know really how to apply it to the list.
8 years ago
]Hello,
I have my code which will generate a random string using an ArrayList. However, I aso want to have it generate them in random lengths, not just using all the chars and numbers. Help please?


Thank you
8 years ago
most common word longer than 5 characters sorry, and Im not sure myself..We coded something using a data_store, but im not sure if its what i need because i do not know how to implement it in this new code. I will attach that code here

this was an in class example
8 years ago
Hello,
I have my code working up to where it reads and opens the file. I know that I need to have it read the lines of text and save it into a map and my teacher also wants me to use the data_store.next(). I am stuck. Can someone please help me figure out how to keep going on this?
My code so far:


or if anyone has better ideas on how i should code this still using a map i would really appreciate it. It is due by 11:55pm and I am stuck. Thank you
8 years ago