Fill in the missing statements or expressions in the following code that checks to ensure that a user enters an integer value at the prompt: var purchase = parseInt(prompt("How many do you want?"," ")); var check = __________; while (__________) { purchase = parseInt(prompt("Enter a whole number:", " ")); ___________________; }

Respuesta :

Limosa

Answer:

The correct fill in the blanks in the given question is given as

var check = num.isInteger(purchase); // giving the input by the user--(1)

      while(!check)  // check the condition .......(2)

      {

check = num.isInteger(purchase);  // taking by the user  in the "num" ..(3)                  

      }

Explanation:

Following are the description of solution

  • In the first statement, we Taking the input in the "check" variable. This statement num.isInteger(purchase); is taking the input and convert this into an "integer" type.
  • The while(!check) is checking and controlling the condition of a while loop.
  • Finally, we taking the input inside the while loop to regulate the condition of while loop.
ACCESS MORE