AdamSturge991
12-05-2008, 04:05 PM
Hello, I have a question on lists of objects. I can't seem to get Alice to allow me to access the ith item of a list of objects so i can rearrange the elements of the list.
The reason i ask is that i've been trying to work on some sample problems that my professor gave out, and this one has been stumping me.
"Write a method called Exchange with one parameter myList that rearranges the elements of myList so that they are in the opposite order."
I have already written a program like this that works fine with numbers, but it uses the "ith item from list" command, which i can't seem to get to if the lists elements are objects.
Thanks for taking the time to read about my problem. :)
The reason i ask is that i've been trying to work on some sample problems that my professor gave out, and this one has been stumping me.
"Write a method called Exchange with one parameter myList that rearranges the elements of myList so that they are in the opposite order."
I have already written a program like this that works fine with numbers, but it uses the "ith item from list" command, which i can't seem to get to if the lists elements are objects.
Thanks for taking the time to read about my problem. :)