Write JavaScript statements to accomplish each of the following:

a) Display the value of the seventh element of array f.
b) Initialize each of the five elements of single-subscripted array g to 8.
c) Total the elements of array c of 100 numeric elements.
d) Copy 11- element array a into the first portion of array b, containing 34 elements.
e) Determine and print the smallest and largest values contained in 99-element floating-point array w.


a)
```
document.write( f[ 6 ] );
```

b)
```
for ( var i = 0; i < 5; i++ )
g[ i ] = 8;
```

c)
```
var total = 0;
for ( var i = 0; i < 100; i++ )
```

d)
```
for ( var i = 0; i < a.length; i++ )
b[ i ] = parseInt( a[ i ] );
```

e)
```
for ( var i = 0; i < 99; i++ )
if ( w[ i ] > w[ i + 1 ] )
highestNumber = parseFloat( w[ i ] );
else
lowestNumber = parseFloat( w[ i ] );
document.writeln( highestNumber + “ ” lowestNumber );
```

Computer Science & Information Technology

You might also like to view...

Windows PC and Apple Mac are types of ________

A) platforms B) operating systems C) hardware D) software

Computer Science & Information Technology

After you create a list of tasks, you can ____________________ your tasks across multiple devices such as your smartphone and laptop, staying up to date and improving your productivity.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Answer the following questions true (T) or false (F)

1. Integer literals beginning with the digit 0 are interpreted to be in decimal notation. 2. Comments beginning with the characters // can extend for multiple lines until the compiler encounters \\.

Computer Science & Information Technology

In a 4-node, the largest search key is found in the ______ subtree.

a) left b) middle-left c) middle-right d) right

Computer Science & Information Technology