I want void loop to go through once

I originally had only "if" statements but I switched to "while" statements in an attempt to try to solve the problem.