02 March 2003 - java_dev (original) (raw)
I am a person, obviously, desperate and oh so damn well desperate to understand java. It puzzles the hell out of me. I have a midterm on it wednesday and a discrete math midterm on monday. I do have a problem though, because this assignment is due on Monday too and I can't seem to understand anything on it.
The question is is that the program has created three arrays. There is an array for item id's, costs, and item names. The three problems are these...
One is to make the id's span from 00 to 99. I did this
// get the id of an item
do{
do{
System.out.print("id " + (i+1));
System.out.print(" Your id between 00 and 99:");
restrictedId = SavitchIn.readLine()
}while(restrictedId !>= 100)
}while( restrictedId > 0)
}
id[i] = restrictedId ;
But this looks like bull.
Another problem is my having to find an item according to an id. I started out with a linear search algorithm,
private static void findItem(int counter)
{
counter = 1
while{
(counter =< & x != )
i = i +1}
if (i =< )
else
System.out.println("Not found")
}
But that doesn't look right either.
The third is my having to delete an item altogether from the list.
Helping. Please. PLEASE.