Conditionals and while loops!?!! THIS IS MADNESS!
Also, your second and third snippits of code won't work as I think you would want. I'm a summing your increment the number so it'll actually increment next time, but it won't. You initialize the integer inside the method bodies, so once the method ends and you call it again, number will be 4 again, not 5.