Search Header Logo

BE METER REVIEW #4

Authored by Reina lara

Computers

12th Grade

Used 11+ times

BE METER REVIEW #4
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

You need to evaluate the following code segment. Line numbers are included for reference only.

01 var n;

02 console.log(typeof n);

03 var a =”3.4”;

04 console.log(typeof a);

05 var textArray=[“Welcome Back”], “Enter a Name”, “Incorrect Answer”];

06 console.log(typeof textArray);

07 var c=2.4;

08 console.log(typeof c);

09 var tag=null;

10 console.log(typeof tag);


Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.

What does the console.log function on lines 02,04,06,08,10 write to the console?

undefined, string,array,number,object

undefined, string,array,object,number

undefined,number,string,array,object

undefined, string,array,number,NaN

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

You are writing an engineering application. You need to create a function that will round numbers to 3 or more decimal places.

You need to create a function that receives the following two parameters:

The value parameter is the number to be formatted

The digits parameter is the number of digits to display

The function must return the value with the number of digits specified.

Which function should you use?

function significance(value, digits){

return value.toPrecision(digits);

}

function significance(value, digits){

return value.toString(digits);

}

function significance(value, digits){

return value.toFixed(digits);

}

function significance(value, digits){

return value.toValueOf(digits);

}

3.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

You analyze the following code fragment. Line numbers are included for reference only.


01 “use strict”;

02 var val1=25;

03 var val2=4;

04 function multiply(){

05 return val1*val2;

06 }

07

08 console.log(“Global multiply returns() ;” + multiply());

09 multiply();

10

11 function getProduct(){

12 var val1=2;

13 var val2=3;

14

15 function multiply(){

16 return val1*val2;

17 }

18

19 return multiply();

20 }

Choose two answers

The call to the multiply function on line 09 returns 100: TRUE

The call to the multiply function on line 09 returns 100: FALSE

The call to the multiply function on line 19 returns 100: TRUE

The call to the multiply function on line 19 returns 100: FALSE

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Evaluate the following code. Line numbers are included for reference only.

01 var n=50;

02 var c=n+5;

03 var a=n%2;

04 var d=c/11;

05 n=d*2;

07 console.log(n,c,a,d);


What is the value of each variable at line 07? To answer, drag the appropriate value to the correct variable. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

NOTE: Each correct selection is worth one point.

n,c,a,d

10, 55,0,5

10,5,0,25

100,25,10,5

100,55,5,25

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

It's creating a function that causes a delay.The function has the following requirements:

-A maximum value must be passed as parameters

- There must be a counter that starts at 1 and increases an unit with a iteration

- The counter value should appear every time the loop itetimes

- The loop should exit after showing the maximum value

Create the following function definition

code segments

1-console.log(recuento ++);

2-if (recuento > maximo) continue;

3-recuento =1;

4-while (false){

5-while (true){

6- if (recuento > maximo) break;

7- }


Order the code and create the program with the instruction above.

1,3,2,5,7

3,5,6,1,7

3,4,6,1,7

3,5,2,1,7

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

runs the following code

var cadena=””;

var j;

for(j=0; j<8;j++){

if (j==2){ continue;}

cadena+=j+” “;

}

Which value is saved in the string variable after you have to execute the code

3 4 5 6 7

1 3 4 5 6 7 8

0 1

0 1 3 4 5 6 7

0 1 3 4 5 6 7 8

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

He's writing a javascript program for a graphic design institute. One of the functions of the program checks whether the height of a graph is equal to or greater than the minimum size, 50, but not less than 100.

As you must complete the code, to answer select the appropriate code segments in the response area

Answers Area:

>= && <

>= || <

<= && >

<= || >

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers