> Java - counter?

Java - counter?

Posted at: 2014-12-18 
int counter = 0;

some thing like this and then in the loop you will check whether the 'counter' is odd or even by the following

if(counter%2==0)

{

then print odd (or whatever you want)

}

else

{

print even

}

No the counter is not random... You will initialize an integer variable yourself like

int counter = 0;

some thing like this and then in the loop you will check whether the 'counter' is odd or even by the following

if(counter%2==0)

{

then print odd (or whatever you want)

}

else

{

print even

}

You forgot to count yourself, Duh!

this part of the assignment is: "if the counter is odd, print out "hello class". if it is even, print out "hello teacher".

I dont know what that means, where is this number coming from, is it random?

then it says, convert it to switch statement (after commenting out)

then make the program interactive to ask the user for the number of times they want to print out blah blah whatever

Mostly I just need help with part 1, but I wont be mad if you did the rest...