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

(Answered) : Questions Problems 93 B Profit 12000 Number Customers 32392 Variable Cost Per Unit 463 Sal Q28647002(Answered) : Questions Problems 93 B Profit 12000 Number Customers 32392 Variable Cost Per Unit 463 Sal Q28647002

Answers and question, exercise 10,11,12 and 13.<br/><img src="https://media.cheggcdn.com/media%2F8ef%2F8efb7ca6-fb9c-47c4-b5fc-d87c77438665%2Fimage" alt="QUESTIONS AND PROBLEMS 93 b. Profit, $12.000; number of customers, 32.392: variable cost per unit $4.63; sales price per unit, $10.34 c.