Commands is used to create an array


Complete the following:

1.Which of the following commands is used to create an array?

a.create
b.declare
c.function
d.source

2.You use the ______________ command to call a function library file.

a.create
b.declare
c.function
d.source

3.Which of the following commands is used to display all variables?

a.create
b.typeset
c.function
d.source

4.You use the ______________ command to create a function named Goals.

a.unset Goals
b.declare -a Goals
c.function Goals ()
d.source Goals

5.Which of the following commands is used to remove a function named Goals?

a.unset Goals
b.declare -a Goals
c.function Goals ()
d.source Goals

6.You use the ______________ statement to display all the values in an array named Beaches.

a.echo ${Beaches[0]}
b.echo ${Beaches[1]}
c.echo ${Beaches[#]}
d.echo ${Beaches[*]}

7.A ______________ refers to the element number in an array.

a.call
b.data value
c.subscript
d.return value

8.______________ is the process of breaking a programming task into smaller pieces.

a.Function calling
b.Subscripting
c.Indexing
d.Modularization

9.A ______________ activates a function.

a.function call
b.return value
c.subscript
d.function module

10.Which of the following commands is used to display the length of the data value located at subscript 5 in the array named Beaches?

a.echo ${Beaches[5]}
b.echo ${#Beaches[4]}
c.echo ${#Beaches[5]}
d.echo ${@Beaches[*]}

11.Which of the following commands is used to display the first value in the array named Beaches?

a.echo ${Beaches[0]}
b.echo ${Beaches[1]}
c.echo ${Beaches[2]}
d.echo ${Beaches[*]}

12.You use the ______________ command to declare a variable so it can only be used in a function.

a.global
b.function
c.declare -a
d.source

13.A value is ______________ to a function when the function is given the value to process.

a.called
b.returned
c.passed
d.evaluated

14.Which of the following commands is used to display the total number of data values in the array named Beaches?

a.echo ${Beaches[]}
b.echo ${*Beaches[#]}
c.echo ${#Beaches[*]}
d.echo ${@Beaches[*]}

15.Which of the following declares an array named States with the elements Florida, Georgia, Maine, Montana, and Alabama?

a.states=(Florida Georgia Maine Montana Alabama)
b.states[]=(Florida Georgia Maine Montana Alabama)
c.states[01234]=(Florida Georgia Maine Montana)Alabama
d.function()=(Florida Georgia Maine Montana Alabama)

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Commands is used to create an array
Reference No:- TGS01931739

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)