Question: 1 . Consider the declaration: int n [ 1 0 ] : What is the index of the last element of this array? a .

1. Consider the declaration: int n[10]: What is the index of the last element of this array?
a. Compiler issues an error message
2. Suppose v is an array with 100 int elements. If 100 is assigned to v [100], what happens?
c. Program will terminate immediately
. Compiler issues a warning message. b
d. Another variable or array will very likely be unexpectedly modified
3. Show contents of the array after the code shown:
double money[4] double temp; (75,50,5,4); if (money[1]> money [2]) money [2] temp;
temp money[1]; money[1] money[2];
}
4. Write a statement to declare an array named scores of twenty-five integer elements.
5. Write a statement that declares an array of characters named letterGrades that contains exactly eighty elements.
6. Using one statement, declare an array named taxRates of 5 elements of type double and initialize the elements to the values 0.10,0.15,0.21,0.28,0.31, respectively.
7. An array of integers named salarySteps contains five elements and has already been declared and initialized.
Write a statement that assigns the value 160000 to the last element of the array salarySteps.
8. An array named values, containing exactly five integers has already been declared and initialized. Write a single statement to add 10 to the value stored in the first element of the array.
9. An array of integers named list contains exactly five elements and has already been declared and initialized.
Write a single statement that assigns a new value to the first element of the array that is equal to twice the value stored in the last element of the array. (Do not modify any values in the array other than the first element.)
10. Given a character array named arr, along with two int variables i and j, write some code that swaps the values of arr[i] and arr[j]. Declare one additional variable.

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!