Question: 1.Fill it with buttons, each containing a description indicating which question it will answer. Each button will answer only one of the questions (3A, 3B,

1.Fill it with buttons, each containing a description indicating which question it will answer.

Each button will answer only one of the questions (3A, 3B, 3C, 4A, 4B, 4C and 4D).

2.When the button is clicked a function is called one for each loop below and record your responses as a JS comment inside each of those functions you have just defined.

A.How many times does the following loop execute and why is the output not displayed on a single line?

for (var a = 0; a < 5; a++)

{

document. write (Go Gamecocks!! );

}

B.What is written to the document by the following loop?

var k = 12;

while (k >= 7)

{

document. write (k + "th item, );

k = k - 1;

}

C.Explain how the following code works in your comment after defining a function that performs this task.

do

{

var userInput = prompt (enter password:, type password here);

}

while (userInput != aAbBcC)

3.Write the JavaScript code for the following tasks. Each number in the output generated must be printed on a new line.

A.A for loop that loops 7 times and prints out: 0 1 2 3 4 5 6.

B.A while loop that loops 6 times and prints out: 2 4 6 8 10 12.

Hint: you can increment your iterator by more than just 1.

C.A do while loop that loops 5 times and prints out: 1 2 3 4 5.

D.A for loop that loops 7 times and prints out: 1 8 27 64 125 216 343.

Hint: use the Math.pow(x,3) method in the body of the loop.

lab13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!