Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part l: (30 pts.) Answer the following questions by circling the correct answer

ID: 3695894 • Letter: P

Question

Part l: (30 pts.) Answer the following questions by circling the correct answer or filling in the provided output area. 1. Which statement best describes the effect of the following code? Dim a(2) As Integer a(0)-10 a(1) 10 a(2) 10 ReDim Preserve a (5) Array a has 3 elements each filled with value 10. b. a. Array a has 6 elements each filled with value 0. c. Array a has 6 elements with the first 3 filled with value 10 and the last 3 filled with o 2. What is the best definition of parallel arrays? a. They are arrays where each element is of a Structure data type. b. They are one or more arrays in which related data is stored at the same index. c. They are arrays which are displayed in separate but side-by-side list boxes on the form. d. They are arrays of different data types, such as an array of Integers and an array of Strings Array people stores names and array heights holds Integer heights in inches. The arrays are 3. parallel. Which code segment correctly asks for an index, displays the name and the corresponding height in feet? Dim people(99) As String Dim heights(99) As Integer Dim index As Integer CInt(InputBox("Enter index")) a. IstOut.Items.Add (people & " has height" & heights/12) b. IstOut.Items.Add (people(0) & " has height"& heights(0)/12) c. IstOut.Items.Add (people(index) & " has height"& heights(index)/12) d. IstOut.Items. Add (people(index) &"has height"&heightsindex;) 12) 4. Which statement is not true about the sequential search algorithm? a. An unordered array must use sequential search. b. The algorithm returns the index of the target if it is found c. The sequential search algorithm is faster than binary search. d. The sequential search algorithm ends when either it finds the target or runs off the end of the array

Explanation / Answer

1. c.

2. b.

3. d.

4. c.

5. c.

6. c.

7. a.

8. c.

9.

5   100   12   76   81   12   45   32

5   12   100   76   81   12   45   32

5   12    12   76   81   100   45   32