Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7.

Respuesta :

if(updateDirection==1){

numUser ++;

else

numUser--;

}

if (numUser==8 && updateDirection==1){

numUser= 9;

}

if(updateDirection==0){

userUser=7;

}

Answer:

num_users = num_users + 1 if update_direction == 1 else num_users - 1

Step-by-step explanation:

This is going to give you the +1 or -1 depending on what the update_direction is = to.  If you have a different direction then just make it -= to that.

ACCESS MORE
EDU ACCESS