I am struggling with some code. I have a variable that is required to change every time a method is invoked. I need the sequence to output the values 0 then 1 then 2 then 3 then 2.
I have managed to write an if statement that changes the integer from 0 to 1 and then I have used else if statements to change the integer to 2 then 3 then back to 2. Can anybody help me to change the integer to 0 upon the first loop? The integer is initialised to 0.