Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to check my answers. If you dont know the question please put that down.

ID: 3550376 • Letter: I

Question

I need to check my answers. If you dont know the question please put that down. I will still give best answer. Thank you


16.  If the string passed to parseInt contains text characters, parseInt will ________.

a) return NaN

b) return 0

c) return the sum of the characters' ASCII values

d) truncate the text entries

17. What output will the following script produce?

var i = 0;

var j = 3;

var counter = 0;

while ( i < 5 )

{

if (i != j)

counter = counter + i;

i = i + 1

}

   document.write( counter );

a) 9

b) 14

c) 3

d) 7

18.  Which of the following is the proper method to access the length of the array arr?

a) arr[].length

b) arr[subscript].length

c) arr.length

d) arr(length)

19.  To divide the value of the seventh element of array a by 2 and assign the result to the variable x, we would write ________.

a) x / 2 = a( 7 )

b) x = a[ 7 ] / 2

c) x = a[ 6 ] / 2

d) x = a( 6 / 2 )

20.  Which of the following is the proper method to dynamically allocate memory to an array of 100 elements?

a) var c = new c[ 100 ];

b) var c = new c( 100 );

c) var c = new Array[ 100 ];

d) var c = new Array( 100 );

21.  The first statement below ________ the array while the second statement ________ the array.

var c;

c = new Array( 12 );

a) declares, initializes

b) initializes, declares

c) declares, allocates

d) allocates, declares

22.  Which of the following is an illegal array initialization statement?

a) var n = [ 10, 20, 30, 40, 50 ];

b) var n = new Array( 10, 20, 30, 40, 50 );

c) var n[ 10, 20, 30, 40, 50 ];

d) var n = new Array( 5 );

    for ( var i = 1; i <= 5; i++ )

       n[ i ] = i * 10 ;

23. What is the value of num assuming that all 12 elements of array test are initialized to 3?

++test[ 7 ];

var num = test[ 7 ];

a) 3

b) 4

c) 8

d) 10

24. What will the browser display if the following script is executed?

<script type  = "text/javascript">

   <!--

   var theArray = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ];

   modifyArray( theArray[ 3 ] );

   document.write( theArray.join( " " ) );

   function modifyArray( i )
   {

      i = 11;

   }  

   //-->

</script>

a) Nothing, the browser will generate an error.

b) 1 2 3 4 5 6 7 8 9

c) 1 2 11 4 5 6 7 8 9

d) 1 2 3 11 5 6 7 8 9

25.  What does the variable string contain after the following code is executed?

var string = "Good luck on the test";

string = string.charAt( 3 );

a) Goo

b) 3

c) d

d) Nothing, the string conversion generates an error.

26.  What does the variable string contain after the following code is executed?

var string = "Good luck on the test";

string = string.split( " " );

a) an array containing the strings "Good", "luck", "on", "the" and "test"

b) the string "Good.luck.on.the.test"

c) the string "Good,luck,on,the,test"

d) Nothing, the string conversion will generate an error.

27.  What is the value of s3 after the following code is executed?

var s1 =

Explanation / Answer

Hello,I am 14 years experienced Computer Science Tutor and Assignment Helper. I am ready to get your assignment done but you have to pay fee for it. I solve each assignment personally and don't post copied solutions from internet like other experts do. For further discussion email me at nettuitions@hotmail.com or discuss with me in Skype. Skype id is hardeep_sp

Thanks





Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote