Lynn Finley

Greenhorn
+ Follow
since Sep 29, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Lynn Finley

Its me again.
I finally got the code to work, but because it is so long I was wandering if their was a way that i could pause my out put in between method calls.
Thanks in advance.
21 years ago
Following is my updated code.
It seems as usual once something is fixed you get 10 more errors. I don't think I understand implementing treemaps much.
I'm getting error messages like
When I try to pass my map collection to the method it tells me incorrect type-- When I try to cast it as an Object it tell's me explicit cast needed to convert?
Also things like getValue() not a method of class java.lang.Object--I thought I was passing the treemap?
can anyone please give me some input.
21 years ago
I have checked and double checked all of my brackets. Am i passing the right paramater to my methods? I think I should pass my collection, in order to iterate over to get the user input? Am I anywhere on the right track.
21 years ago
Hey Maulin,
Thank you
When I put that in it allowed me to print my array, however it's printing them twice.
I tried commeting out each of my methods to see if I could get any of them to work it said "Statement Expected"...do you know what this message means??
EmployeeMap.java :55: Statement expected.
public void getName(map m)
^
21 years ago
I created an array of objects and placed them in a treemap. from the treemap, i have to print the items in the collection from a method and without a method.
I have to get user input to get and remove an employee from collection. (I have to use id as key) But this code is not working, if someone can look at it and point me in the right direction, i would appreciate it.

If anyone can please.....look at this and help i will be forever grateful..
21 years ago
Every time I think I'm making progress, I get stumped. Can anyone give me a hint at what I'm doing wrong. I have to use a stack to check if user input is a palindrome. However, whatever I put in.... the printout says that it is a palindrome.
I've tried if(true)....and also if(!true)....in my statement...
Your help is greatly appreciated...
22 years ago
The reason my method is written that way is my assignment said to write a recursive method that returns the number of ones in the binary representation of N. Use the fact that this number equals the number of ones in the representation of N/2, plus 1, if N is odd.
I just can't figure out how to pass my variable one to the main method in order to check my work. is passing a variable to the main method even possible with out creating a constructor?
Thanks for your input..
22 years ago
Need to write a recursive method that will count the number of ones in a binary representation of a number that is entered from the keyboard. I can't figure out how to return my ones to check if they are right. Here is the code I hava so far:

Can anyone help me with this problem?
[ edited to remove long blank line in code -ds ]
[ January 12, 2003: Message edited by: Dirk Schreckmann ]
22 years ago
Thank you so much for all your help
:-)
22 years ago
I've used the follwing code and it appears to work except, I have one problem...it prints my second arraylist multiple times...

Thanks for all of your help
[ October 01, 2002: Message edited by: Lynn Finley ]
22 years ago
I've tried using mod division to come up with the answer but my output does not come out right. This is what I've used
for(int1=1;i<=100; i++)
{
if (i%2==0)
System.out.print(i)
else
if (i%2!=0)
System.out.print(i)
}
when I do this my output is 1,2,3,4,5 etc. starting with 1 at the beginning.
I just don't know how to make 1 start in the middle and the other numbers to correctly wrap around it.
Thanks for your help
22 years ago
Please...does anyone know what I'm doing wrong.
Thanks in advance
22 years ago
Here is the problem. I have to print 100 integers in an array list.
1,2,3,4,,5,6..............100
Then I need to print the elements starting from the middle of the list.
100,98,96,94��1��.93,95,97,99 ....
with 1 being in the middle.
Can anyone help me with this.
I found this method in Java Package, but I�m confused on how to use it
add
public void add(int index, Object element)
Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted
Here is the code I have so far�.Can anyone help�..

[ September 29, 2002: Message edited by: Lynn Finley ]

(Marilyn added code tags)
[ September 29, 2002: Message edited by: Marilyn de Queiroz ]
22 years ago