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...

Information is what is typically entered into a database. Data is the finished product of the database

Indicate whether the statement is true or false

Computer Science & Information Technology

Alt/Opt-clicking between two layers in the Layers panel does what?

What will be an ideal response?

Computer Science & Information Technology