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

(Solved) : Objective Using Basic Operations Input Output Cin Cout Using Basic Data Types Int Double E Q27365358 . . . .(Solved) : Objective Using Basic Operations Input Output Cin Cout Using Basic Data Types Int Double E Q27365358 . . . .

<br/><img src="https://media.cheggcdn.com/media%2F4e4%2F4e42f2f3-9760-4f25-b356-5eb61d9a31cb%2Fimage" alt="Objective: Using basic operations for input and output (cin and cout) Using basic data types (int, double, etc.) Using selection statement (if else) Using repetition statement (loops) Due