Question
Question 1 (2 points) Arrays are objects and have a fixed length. Question 1 options: True False Question 2 (2 points) Given an array of
Question 1 (2 points)
Arrays are objects and have a fixed length.
Question 1 options:
True | |
False |
Question 2 (2 points)
Given an array of doubles a= { 1.5, 2.1, 3.3, 4.1};
This will print the contents of the array to the screen:
PRINT (array)
Question 2 options:
True | |
False |
Question 3 (2 points)
This block of code will print the contents of the array to the console.
string[] capitals = { "Sofia", "Washington", "London", "Paris" };
FOREACH ( string capital in the array capitals)
PRINT capital
Question 3 options:
True | |
False |
Question 4 (2 points)
Which of the following is an incorrect process for declaring and initializing an array?
Question 4 options:
| int [] nums={3, 6, 4, 2, 1}; |
| int[] myArray = new int[6]; |
| int[] arr = new int[5]; for (int i = 0; i < arr.Length; i++) { arr[i] = i; } |
| int[] myNums = new int[] { 6, 5, 7, 10 }; |
| None, all 4 processes are correct. |
Question 5 (2 points)
For searching a 2D array of ints, called nums, to find the largest value, the local variable int biggest should be set which of the following values?
Question 5 options:
| 0 |
| the first element of the array nums |
| any value not in the array nums |
| -1 |
Submit Quiz0 of 5 questions saved
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started