Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5.What is a counter-driven loop? 6.Write a JavaScript function named countUp( ), which displays 1 to 10. 7.Modify the countUp( ) you wrote in the

5.What is a counter-driven loop?

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

7.Modify the countUp( ) you wrote in the previous question to countUp( num), where num is a parameter. The function displays 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.";

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

Explain the factors affecting dividend policy in detail.

Answered: 1 week ago

Question

Explain walter's model of dividend policy.

Answered: 1 week ago