lab1pseudocode
public c v1 · immutablewhile (1) { if (button) { while (button) { //when button is depressed, start timer timer++; if (timer == 250) { var = 1; } //if sufficient time has passed, the button press is valid } } if (var) { if (!button) { //when button is released, count the press (if valid) and reset the valid indicator pushcount++; var = 0; } }}