Download presentation
Presentation is loading. Please wait.
1
Chapter seven review
2
What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For i = 1 To 4 Input #1, a(i) Next i For i = 4 To 1 Step -2 picBox.Print a(i); Next i End Sub Contents of DATA.TXT: 1,3,5,7
3
Output: 7 3
4
What is the output of: Dim a(2 To 9) As Integer, i As Integer, _ k As Integer, sum As Integer For i = 2 To 9 a(i) = i Next i sum = 0 For k = 4 To 6 sum = sum + 10 ^ a(k-2) Next k picBox.Print sum
5
Output: 11100
6
What is the output of: Dim a(-1 to 5) As Single, x As Single Open "DATA.TXT" For Input As #1 Do While Not EOF(1) Input #1, x a(x) = a(x) + 3 Loop Close #1 picBox.Cls picBox.Print a(0); a(2) Contents of DATA.TXT: 0, 1, 5, 2, 0
7
Output: 6 3
8
Dim a(-2 To 5), b As Integer Dim i As Integer, j As Integer Open "DATA.TXT" For Input As #1 num = 0 For i = 3 To 5 Input #1, a(i) Next i For j = -1 To 1 Input #1, k b = b + a(k) Next j picBox.Print b Contents of DATA.TXT: 2, 1, 0, -1, 3, 3
9
Output: 4
10
How many elements are in the array declared by Dim myArray(1 To 5, 1 To 5) As Single How many elements are in the array declared by Dim myArray(0 To 3, 1 To 3) As Single
11
7.1
12
3. Stuhldreher Crowley
14
4. 11
16
5. 6 2 9 11 3 4
18
6. 10 12 3 14
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.