4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50
1. 2 1 10 3. 0 360 10 sin() 4.1.2 For X = X + 1 X = X + 1 X 1 X 4.1.3 4.1.3 n = 1 1 4.1.4 4.1.4 4.1.5 4.1.5 1. 2. G Y G( 1 + r / 100 ) Y 51
4.1.6 Sum 0 For Rnd =RAND() Excel VBA Rnd 4.1.6 Int(x) x Int( Rnd*100) 2 Sum = Sum + ten Sum 2 ten N k= 1 k = 1+ 2 + 3 + 4 + L + k + L + N Sum = Sum + i 4.1.7 Sum 4.1.8 Int(-2.3) -3 Int(2.5) 2 4.1.7 I=1 Sum Sum + 1 (0+1) (0) + 1 I=2 Sum Sum + 2 (0+1+2) (0+1) + 2 I=3 Sum Sum + 3 (0+1+2+3) (0+1+2) + 3 52
0 = 1 1 For i=1 ( ) ( ) * 2 ( 1 * 2 ) (1)* 2 i=2 ( ) ( ) * 2 ( 1* 2 * 2 ) ( 1* 2 )* 2 i=3 ( ) ( ) * 2 ( 1* 2 * 2 * 2 ) ( 1* 2 * 2 ) * 2 1 2 3 N k= 1 k = 1 + 2 + 3 + L+ N 53 N ( N + 1)( 2N 1) 2 2 2 2 2 + 4 N k= 1 ( x x) k N 2 = 6
4.1.3 For For 2 For i For j 4.1.11 For i =1 to 10 For j =1 to 10 Next i Next j 4.1.11 i j 4.1.12 4.1.12 For 4.1.12 i j 4.1.13 4.1.13 1. 3 2. 3. 100 54
4.2 Check Point 1. If 2. Select Cse 4.2.1 If If Then Else A A B B A B If A Then A ElseIf B Then B End If 4.2.1 4.2.1 A A 55
0 x 1 0 = x And x = 1 2 Not 10 And 11 Or 12 If (0 < x And x < 1) Or y > 0 Then If If 4.2.2 ElseIf 4.2.3 4.2.4 ElseIf 4.2.4 4.2.3 ElseIf 4.2.5 4.2.2 If MsgBox 2 Beep 1. 56
4.2.6 Mod () Mod 5 Mod 3 2 4.2.6 ten 4.2.7 ten Mx nmx 1. 4.2.7 2. 2 Sum SUM sum ( ) 57
4.2.2 Select Cse If Select Cse x Cse Is = 80 A Select Cse Cse 70 To 79 End B Select Cse 6, 8, 9 Cse C Cse Else Is D End Select 4.2.8 4.2.9 To Is Cse 1 To 3, Is 10 4.2.3 (Sequence)(if then else)(while) GOTO ( do loop ) ( select cse ) ( for ) : 58
4.3 For Check Point 1. While 2. Do Loop 4.3.1 While While Wend 4.3.1 While Wend 4.3.1 4.3.2 : () 4.3.2 n +1 n = 1 Cells(1,1) Esc Ctrl + Brek 59
4.3.2 Do Loop Do Do Loop 4.3.3 While Until Do Loop 4.3.3 4.3.4 1 Do While 4.3.5 Do Loop While Loop 4.3.4 (Until) i 10 4.3.6 Do i=0 i = 0 Loop While Do Do i = i + 1 i = i + 1 4.3.5 Cells(i, 1) = i Cells(i, 2) = i Loop Until i >= 10 Loop While i < 10 4.3.6 4.3.7 (While) i 10 4.3.7 (Until) i 10 4.3.8 i = 0 Do Until i >= 10 i = i + 1 Cells(i, 3) = i Loop i = 0 Do While i < 10 i = i + 1 Cells(i, 4) = i Loop 4.3.8 4.3.9 (While) i 10 4.3.9 60
4.3.3 Exit 4.3.10 0.2 Do Loop Exit Do Do Exit For For Exit Sub Exit Function 4.3.10 4.3.11 4.3.12.1 1 l im 1 + n n n = e 61
4.4 Check Point 1. 2. 2 3 4.4.1 TOEIC Ziryo01=555 Ziryo02=369 Ziryo03=412 4.4.1 4.4.1 Ziryo(1)1 1 Ziryo(19) 19 4.4.2 4.4.2 62
1 Dim 4.4.3 0 4.4.3 2 2 2 2 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. 7. 1 Dim ten(20,5) ten(3,2)=59 ten(5,3)=68 ten(7,4)=53 1. 1 63
4.4.2 2 A = (i, j) 11 21 31 12 22 32 13 23 33 i j ij i j c ij = ij + b ij 4.4.4 c(i,j) = (i,j) + b(i,j) 4.4.4 C = AB c 21 c c c 11 21 31 c c c 12 22 32 c c c 13 23 33 = 11 21 31 12 22 32 13 23 33 b b b 11 21 31 b b b 12 22 32 b b b 13 23 33 c21 = 21 b11 + 22 b21 +23 b31 i 1 ci1 = i1 b11 + i2 b21 +i3 b31 i j cij = i1 b1j + i2 b2j + i3 b3j 3 cij i1b1j + i2b 2 j + i3b3 j = = ik k = 1 b kj 1. 2. A n A n α = 0 0 0 β 0 0 0 γ n n α = 0 0 β 0 n 0 0 0 n γ 64
4.5 Check Point 1. Sub Function 2. 4.5.1 Sub 1 4.5.1 Sub 4.5.1 Sub Sub End Sub Sub 4.5.2 Cll 4.5.2 65
BASIC 4.5.3 test I test1 I Sub test() For I=1 To 10 Cll test1( ) Next I End Sub Sub test1( ) I = I + 1 End Sub 4.5.3 4.5.4 4.5.4 66
4.5.5 4.5.5 A I B n B I 4.5.6 4.5.6 4.5.7 R cosθ sin θ sin θ cosθ ( θ) = 4.5.7 67
Sub Dim pi As Double 4.5.7Double pi = 3.14159 Excel pi() VBA tn(/4) = tn(1) =/4 = 4tn(1) () the Sub Cll rottion ( the, p( ), q( ) ) Sub rottion ( x, ( ), b( ) ) p(1), p(2) p( ) Sub ( ) 4.5.8 End Sub 4.5.8 b(1), b(2) q( ) 1. y = sin (0) 30 2. A n α = 0 0 0 β 0 0 0 γ n n α = 0 0 β 0 n 0 0 0 n γ 68
4.5.2 Function Sub Function f(x) = sin(x) / 2 sin(/2) 1 4.5.9 sin(x) 4.5.9 Excel Bsic Function 4.5.10 sin(z) 4.5.11 the = sin ( z ) Function sin ( w ) 4.5.10 sin = 90 End Function 4.5.11 2 y = rctn 1 y θ 2 y = sin θ sin θ tn θ = = cos θ θ = sin 1 = sin θ 1 sin = y y 2 2 2 1 y θ ( y) rcsin(y) 1 y = 2 69
1 Function 2 ds = dx 2 r x 2 S = r 0 r 2 x 2 dx 1. 2. 70
4.6 Check Point 1. 2. 4.6.1 Open Close Open For As Print, test! Output Close 4.6.1 Print #(), 1, 2, 3 4.6.2 test.dt 4.6.2 Z: C Progrm Files Dell "C: Progrm Files Dell test.dt" 71
4.6.2 Input Input #(), 1, 2, 3 4.6.34.6.3 4.6.3 While Wend EOF ( End of File ) (True) EOF (n) n 4.6.4 Line Input #() Input #(), 1, 2, 3 Line Input #(), dummy$ 4.6.4 4.6.5 4.6.5 72
73