Computers and Technology

What does the following code segment do?
var isseven =false;
while ( isseven==false )
{
var roll1=math. floor(math. random( )*6+1);
var roll2=math. floor(math. random( )*6+1);
if(roll1 + roll2 ==7)
{
isseven = true;
alert(roll1 +"--"+roll2);
}
}
it keeps generating two random numbers of any values until the sum of the two numbers is 7.
it keeps generateing two random numbers between 1 and 6, and adds up the two numbers.
it keeps generating two random numbers between 1 and 6, until the sum of the two numbers is 7.
it keeps generating two random numbers between 1 and 6, then check if the sum of the two numbers is 7.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:10, reycaden
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
image
Computers and Technology, 22.06.2019 19:20, mahaleyrenee1195
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, cravens511peeelg
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
Do you know the correct answer?
What does the following code segment do?
var isseven =false;
while ( isseven==false )<...

Questions in other subjects:

Konu
Geography, 17.02.2021 19:30