trouble with array method
i'm almost 100% complete with the array method that i'm writing. but i'm having trouble.
i wrote a method that returns a string ("up_order", "down_order", "no_order") if the elements in the integer array correspond.
what's wrong with the code?
if(i>0 && list[i]>list[i-1])
order = "up_order";
else if(i>0 && list[i-1]>list[i])
if the return statement is outside the for loop like i have it in the code above, it says that order may have not been initialized. if the return statement is inside the for loop it says i need a return statement. i'm completely lost
Moderator Edit: Code tags added