Course Solutions Uncategorized (Solved) : 5 Counter Driven Loop 6write Javascript Function Named Countup Displays 1 10 7modify Count Q30592511 . . . .

(Solved) : 5 Counter Driven Loop 6write Javascript Function Named Countup Displays 1 10 7modify Count Q30592511 . . . .

 

5.What is a counter-driven loop?

6.Write a JavaScript function named countUp( ), which displays 1to 10.

7.Modify the countUp( ) you wrote in the previous question tocountUp( num), where num is a parameter.   The functiondisplays from 1 to num.

8.

What does the following code segment do?

var count =0;
var sevens =0 ;

while(count<100)
{
  var roll1 = Math.floor(Math.random()*6+1);
  var roll2 = Math.floor(Math.random()*6+1);

  if(roll1 + roll2 == 7)
sevens = sevens +1;

}

document.getElementById(“outputDiv”).innerHTML =”Seven appears”+sevens +” times.”;

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post