Question: Each variable in a one-dimensional array is identified by a unique number, called a(n)____, which the computer assigns to the variable when the array is

Each variable in a one-dimensional array is identified by a unique number, called a(n)____, which the computer assigns to the variable when the array is created.

Question 1 options: superscript

INDEX

footnote

annotation

Question 2 (3 points) The first variable in a one-dimensional array called x is assigned a subscript of ____.

Question 2 options: -1

0

1

x

Question 3 (3 points) You refer to each variable in an array by the arrays name and the variables subscript, which is specified in a set of ____ immediately following the array name. Question 3 options: brackets [ ]

braces { }

parentheses ( )

slashes / /

Question 4 (3 points) Which of the following do you use to declare and initialize a five-element double array named prices, in which the first element is initialized to 6.5, while the others are initialized to 0.0?

Question 4 options: double prices[5] = {6.5, 0, 0, 0, 0, 0};

double prices[5] = {0, 0, 6.5};

double prices[5] = {0, 6.5, 0, 0, 0};

double prices[5] = {6.5};

Question 5 (3 points) The following statement declares an array. char code [3 ]; What are the subscripts of the elements stored in the array?

Question 5 options: 1, 2, 3

0, 1, 2

0, 0, 0

1, 3, 5

Question 6 (3 points) What does the following statement do? code [0 ] ='A';

Question 6 options: Tests to see if element 0 of the code array is equal to the letter A Assigns the letter A to the first element in the code array Searches through the elements of the code array to see if the letter A exists Replaces all of the elements of the code array with the letter A Question 7 (3 points) Each variable (element) in a two-dimensional array is identified by a unique combination of two subscripts, which the computer assigns to the variable when the array is created.The subscripts specify the variables ____ and ____ position in the array. Question 7 options: row, column header, footer left, right top, bottom Question 8 (3 points) What symbol do you use next to a data type to indicate an array? Question 8 options: ( ) [ ] { } | | Question 9 (3 points) What is the index of 300? int [] a = {50, 75, 100, 150, 200, 300, 450, 510, 700}; Question 9 options: 3 4 5 6 Question 10 (3 points) What is the length of the following array? int[] a = {2, 4, 6, 8, 10}; Question 10 options: 5 6 7 10 Question 11 (3 points) if we have the statement int k[8]; what is the value in k[4]? Question 11 options: 0 garbage a space 3 Question 12 (3 points) if we have the statement int k[8] = {1, 2, 3, 4, 5, 6, 7, 8}; what is the value in k[4]? Question 12 options: 4 garbage 5 3 Question 13 (3 points) if we have the statement int k[8] = {}; what is the value in k[4]? Question 13 options: 0 garbage a space 3 Question 14 (3 points) if we have the statement int k[8] = {1, 2, 3}; what is the value in k[4]? Question 14 options: 0 garbage a space 3 Question 15 (3 points) if we have the statement int k[8]; will the C statement k[14] = 44; compile? Question 15 options: yes no Question 16 (3 points) does C do array bounds checking??? Question 16 options: yes no ArraysSA Question 17 (2 points) given int k[5] = {2, 5, 1, 7, 9}; add the element with the value of 2 to the element with the value of 9 and store the sum in the element with the value of 2 Question 17 options: k[1] = k[5] + k[1]; k[0] = k[5] + k[1]; k[6] = k[5] + k[1]; k[0] = k[4] + k[0];

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!