Originally Posted by miss confused
is upByThree in the same class or in a separate class?
If same class, put it after main method like this:
put int x = 0 in main method.
public static int upByThree( int x)
x = console.nextInt();
For x times, you, in main method:
x = upByThree(x);
int N = 0;
int otherVariable = 1;
while (N > x)
N = N +1;
otherVariable = otherVariable + 3;
If in a separate class have upByThree but have it take no parameters as you can have it defined in the method. I think you need to have a this if you the same name as a private variable, or something along those lines.
Then in the main method in your other class:
separateClass referenceVariable = new seperateClass();
int x = referenceVariable.upByThreei();
then do as shown before with while loop.