ISDS 505 Midterm 1 Chapter 6 Using Arrays Complete latest solutions.
In an array, every element has the same - Answer- data type The operator used to create objects is - Answer- new Which of the following correctly declares an array of six integers? a. int array[6]; b. int[] array = 6; c. int[6] array; d. int[] array = new int[6]; - Answer- d. int[] array = new int[6]; If you define an array to contain 10 elements, then the highest array subscript you can use is _____________________. - Answer- 9 Initializing an array is _____________________ in C#. a. optional b. required c. difficult d. prohibited - Answer- a. optional //you can have an empty array When you declare an array of six double elements but provide no initialization values, the value of the first element is a. 0.0 b. 1.0 c. 5.0 d. unknown - Answer- a. 0.0 Which of the following correctly declares an array of four integers? a. int[] ages = new int[4] {20, 30, 40, 50}; b. int[] ages = new int[] {20, 30, 40, 50}; c. int[] ages = {20, 30, 40, 50}; d. all of these - Answer- d. all of these When an ages array is correctly initialized using the values {20, 30, 40, 50}, then the value of ages[1] is _____________________. a. 0 b. 20 c. 30 d. undefined - Answer- c. 30 When an ages array is correctly initialized using the values {20, 30, 40, 50}, then the value of ages[4] is _____________________. a. 0 b. 4 c. 50 d. undefined - Answer- d. undefined When you declare an array as int[] temperature = {0, 32, 50, 90, 212, 451};, the value of temperature.Length is _____________________.
Geschreven voor
- Instelling
- ISDS 505
- Vak
- ISDS 505
Documentinformatie
- Geüpload op
- 18 maart 2024
- Aantal pagina's
- 6
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
isds 505 midterm 1 chapter 6 using arrays complete