untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 Visual Basic

2 2004 Visual Basic CIP + Visual Basic /.2004 ISBN I. II. III. Visual Basic IV. TP312 CIP * CD

3 2004 Visual Basic Visual Basic

4 VB Windows autorun.exe 5. VB VB VB VB 5 Turbo C 2.0 VB VB ~ VB.doc help.hlp

5

6 Visual Basic Visual Basic Visual Basic

7 MsgBox MsgBox Tab For Do GoTo

8 Sub Function KeyPress KeyDown KeyUp

9 Visual Basic DoEvents

10

11 >>>> % DOS 30

12

13 Data_Structure=(D S) D S D 2 D D D R B=(D R)

14 n(n 0) a 1 a 2 a 3 a n 2 3 i(1 i n) n in i+1 ii 1 n n i(1 i n)i+1 nn i1 n 1

15 top 2 s(1:m) m s(1:m)s(bottom)s(top) top=0 top=m 3 1 top 1 2 top rear front 4 s(1:m)

16 6 1 rearfront frontrear rear=front=m 1 rear=rear+1 rear=m+1rear=1 s=1 2 front=front+1 front=m+1front=1 s= xia i-1 a i a i 1 p

17 1 7 x*s *p a i 2 i a i 1 p a i a i 1 next pnexta i a i a i n i 1 i n i=n+1 *p *pp =NULL*ppnext =NULL 2 next prior head 3 NULL (a 1 a 2 a n ) (b 1 b 2 b m ) (a 1 a n b 1 b m ) a n b 1 a n

18 8 1 NULL p pnext Treen(n 0) T T Root m(m 0)T l T 2 T m Subtree 1Degree Degree Leaf 2Child Parents Child ParentsSibling 3Ancestor Descendant k k s k k s Ancestork s k Descendant k k

19 1 9 4path k 1 k 2 k i k i k i+1 1 i j k l k j Path j 1 5 Level Height Level 1 1Height Depth 0 6 OrderedTreeUnorderedTree OrderedTreeUnorderedTree 2 1 BinaryTreen(n=0)(n=0) i2 i 1 i 1 2 k 2 k 1k 1 3 n 0 2 n 2 n 0 =n 2 +1 k 2 k 1 Full Binary Tree

20 Complete BinaryTree 1 4 n log 2 n + 3 lchild rchild BinTNode BinTreeroot root root=null n2n n 1 n+1 parent 3 3 1

21 k k k

22 12 1 log 2 n R 1 R 2 R 2 R 1 R 2 R 1 R 2 R 1 2 R 3 3 R n n 1 n 2 n d 1 d 1 d 1 d 2 <d 1 d t =1 d t <d t 1< <d 2 <d 1 3 R 1 R 2 R n i 1 i<n AR i R n R min R min R i R min i R i R min B i 1 n n 1 n 1 n 2 n Quick Sort R[1] R[h] temp R[1] R[i 1] R[i+1] R[h] temp temp tempr[i]r[1] R[i 1] temp.key

23 1 13 R[i+1] R[h] 1 i h R[1] R[i 1] R[i+1] R[h] A B C D D 2. A C B D C 3. A C B D D 4. A C B D A 5. A C B D B 6. A C B D

24 14 1 C 7. A C B D D 8. A B C D E F A ABCDEF B DBEAFC C ABDECF D DEBFCA B 9. A C B D A A B C D D A 32 B 31 C 16 D 15 C 12. n A n+1 B n C (n+1)/2 D n/2 B 13. T T A 8 B 7 C 6 D 5 A

25 n log 2 n DBEAFCABDEFC DEBFCA 4. n(n 1)/ front=6rear= N O(Nlog 2 N)

26 / goto 2 3

27

28 18 1 A C B D B 2. A C B D A 3. A B C D D 4. A C B D B 5. A C A B D

29

30 P D C A 2 3 4

31

32 N-S PADPDL

33 / / 2

34

35 PFD A B C D B 2. 3 A B C D D

36 A B C D A 4. A B C D B 5. A B C D C 6. A C B D A 7. 4 A B C D B 8. A B C D B A B C D I D 10. A C B D

37 3 27 A 11. A PAD B SA C SC D DFD A 12. A PAD B PFD C N-S D DFD D 13. A B C D D 14. A C B D D 15. A B C D A A B C D D 17. A C B D C 18.

38 28 1 A B C D C A B C D A Jackson

39 Data Database DB DataBase Management System DBMS DBMS 6 Database Administrator DBA Database system DBS 5 Database Application System DBAS 3 7

40 DBMS

41 E-R E-R E-R 3 E-R

42 E-RRDBMS A B C D A 2. A B C D A 3.

43 4 33 A C B D B 4. A B C D B 5. A B C D D 6. A C B D A 7. E-R A B C D B 8. 4 A - E-R C B D A 9. A C B D D A C B D C 11.

44 34 1 A B C D C 12. A B C D A 13. A B C D B 14. A B C D B 15. E-R A B C D C 16. A B C D A 17. A C B D C 18. A C B D D 19. A B C D E-R D

45 E-R 8. E-R

46 2 >>>>

47 5 Visual Basic Visual Basic 1. Visual Basic 2. Visual Basic 6.0 Visual Basic Windows Visual Basic 1. Visual Basic Visual Basic 2. Visual Basic 5.1.3

48 Visual Basic 1. Visual Basic Form1 2..frm.bas.cls.vbp.vbg.res ActiveX ABCD 1 Visual Basic A Visual BasicWindows B VisualWindows C D Visual BasicOOP Visual BasicWindows C C 2Visual Basic

49 5 Visual Basic 39 A B C D Visual BasicVisual Basic B 3 Visual Basic A res B frm C vbp D cls Visual Basic res Visual Basic frm Visual Basic vbp Visual Basic cls Visual BasicC C 4 A bas B res C fnn D ocx 4 basresfrm ocx ActiveX D D 5Visual Basic A B C D Visual Basic A 6EXE A B C D 4 C 7 Visual Basic A B C Visual BasicREM D

50 40 2 Visual Basic _Visual Basic REM REM Visual Basic Visual Basic Visual Basic B 8 A Visual Basic B Visual Basic C Visual Basic D Visual Basic Visual Basic B 9Visual Basic A B C D Visual Basic A 10Command1 Caption(x) Alt+xCaption Ax & Cx # Bx & Dx # Caption& Alt+ A 11 A CCtrl+N B DF4 Ctrl+NF4

51 5 Visual Basic 41 D 12 A If x=y Then t=x: x=y y=t C If x=y Then t=x x=y y=t B If x=y Then t=x, x=y, y=t D If x=y Then t=x; x=y; y=t Visual Basic A A 13 Visual Basic A C B D Visual Basic Sub MainA A 14 A B C D Visual Basic3 B Visual Basic Visual Basic 3 2 (BorderStyle) BorderStyle6 Windows 6 3Visual Basictwip Visual Basictwip 1=1 440

52 42 2 twip ScaleMode ScaleMode 4 WindowState 3 WindowState

53 Visual Basic 1 Visual Basic Visual Basic 2. = 3 Visual Basic Visual Basic Click DblClick Load MouseDown 4

54 44 2 [.] [] Windows 2 AutoRedraw BackColor ForeColor BackColor BorderStyle CaptionForm1 Form2 ControlBox BorderStyle 0 Enabled Height Width Icon.ico MaxButton MinButton Picture 1 Visual Basic

55 6 45 WindowState Click DblClick Load Unload Activate Deactivate Paint Visual Basic 6.03 Visual Basic.exe Visual Basic 2.2 ActiveX 2 1 Name Visual Basic

56 A B C D Visual Basic 4 B 2Form1 Visual Basic A From1.Caption ="Visual Basic" B From1.Value="Visual Basic" C Form.Caption="Visual Basic" D Form.Value="Visual Basic" Value B D Caption From. = From Form1 C C

57 A C B D C 4 A BorderStyle B WindowState C Height Width D MaxButton BorderStyle Height Width MaxButton WindowState0 1 2 WindowState 2 B 5 A C B D Visual Basic B 6 Form1Label1 A Left Top B Right Top C Right Height D Left Height Left TopLeft Top Label1.Left=Form1.Left Label1.Left Label1.Top=0 A 7 Form2.Caption="Open"Form2 Caption Open

58 48 2 A C B D Visual Basic. = Form2 Caption Open C 8 AName BName C Name DName Name Caption A A 9 A UnloadForm1Form1 BLoad C Enabled False DHeight Width A Unload A 10 A Picutre B Caption C Name D Icon Visual BasicName C 11 Frm1Cmd1 A Form_Click() Command1_Click() B Frm1_Click() Command1_Click() C Form_Click() Cmd1_Click() D Frm1_Click() Cmd1_Click()

59 6 49 Form_Click() ClickC C Text1ABC 6 1 A Private Sub Command1_Click() Text1.Text="ABC" C Private Sub Command1_Click() Text1="ABC" B Private Sub Command1_Click() Text1.Name=ABC D Private Sub Command1_Click() Text1.Text =Chr(65)&Chr(66)&Chr(67) B 3ABC C Text Text1Text B Label LabelCaption NameLabel1 Caption Name 2 StartUpPosition StartUpPosition 3 2 StyleStyle 0 12

60 50 2 Style 4 Text1 Text2Text2 Text1 SetFocusText1.SetFocus Text1.SetFocus 5 WindowStateMaximized 2 Minimized 1 Normal 0 WindowState

61 Visual Basic 1 1 ASCII 0 Visual Basic E e D d

62 TrueFalse # mm/dd/yyyy mm-dd-yyyy 2. Visual Basic Type Type As As End Type 3. Enum [Public Private]Enum [= ] [= ] End Enum Public Private Public Visual Basic Dim Static

63 Public Global 2 Variant VarType Variant16 3 Dim Static % & $ Visual Basic Visual Basic Visual Basic Visual Basic ^ / \ Mod +&

64 Visual Basic True False Visual Basic00 ASCII 2 Visual Basic Single A Time% B Sheigh t! C Name$ D CXYZ@ Visual BasicDim % A% A & A& A! A! A # A# A@ A $ A$ A B

65 Type Student number As String name As String age As Integer End Type A Student.name="" C Dim s As Type Student S.name="" B Dim s As Student s.name= "" D Dim s As Type s.name="" A C D B B 3Visual Basic A A#A B 4A C?xY D consta A# B C* D D 4 A " "+" " C " "& 150 B " "+ 150 D " "&" " + & + & B B 5 A "01/03/2002" C #1/03/2002# B Date("01/03/2002") D 01/03/2002 ##MM/DD/YYYY# C C 6

66 56 2 Dim TestDate As Date TestDate A TextDate=#1/1/2002# B T estdate=#"1 /1/2002"# C TextDate=date("1/1/2002") D TestDate=Format("m/d/yy","1/1/2002") #mm/dd/yyyy# # #5/1/2004# A 7 Visual BasicSqr(a+B)^3*2 A Sqr B + C ^ D * B 8 cos 2 (a+b)+5e 2 Visual Basic A cos(a+b)^2+5*exp(2) C cos(a+b)^2+5*ln(2) B cos^2(a+b)+5*exp(2) D cos^2(a+b)+5*ln(2) Visual Basic A A 9 String(n, "str") A Bn Cn D n String(n, "str") n n s B 10EOF() A B C D EOF B 11 Mid("abcdefghijk",5,3)

67 7 57 A efg B fgh C efghjik D fghijk Mid(A$,B,C)A$BC abcdefghijk5 3efg A 12True A "1"+ 2 ="12" B "1"+"2"="3" C "1"& 2 ="12" D "1"&"2"=" 3" Visual Basic A "1"+ 2"1"1 3C "1"& 22"2" "12" B D"3""12" C 13 A Rtrim() B Ltrim() C Left() D Trim() Rtrim(A$,x)xLtrim(A$,x)x Trim(A$,x)xLeft(A$,x) x B 14str1 str2 A Left B Mid C String D Instr 4 Left Mid String Instr D 15a="Visual Basic"b="Basic" A b=left(a,8,12) C b=rigth(a,5,5) B b=mid(a,8,5) D b=left(a,8,5) a b B B A Len("1234")+5 B Val("1234")+5

68 58 2 C Str(1234)&5 D Cstr(1234)+ "5" 4 LenA 9 ValB 1239 Str C12345 CstrD12345 B 17 Dim X As Integer Sgn(X)1X A C 0 B 0 D 0 Sgn(X) X X 0Sgn(X) 1X=0 Sgn(X) 0X 0Sgn(X)1 D D 18a10 a 15 Visual Basic A 10 a 15 B a=11 Or a=12 Or a=13 Or a=14 C a 10 And a 15 D Not (a =10) And (a =15) 10 a 15 a 10 a 15 C10 a 15 a Ba 10Not(a =10),a 15Not(a =15) D Visual BasicA A 19a=3 b=5 A a>=b And b>10 C (a<0) Eqv (b>0) B (a>b)or (b>0) D ( 3+5>A)And (b>0) B 20 A="Good Morning. " B="Afternoon,Boys. " Good Boys. A Left(A,5)+Right(B,5) C Mid(A,1,5)+Mid(B,1,6) B Left(A,10)+Right(B,6) D Mid(A+B,1,11)

69 7 59 Left(A,5) A5 Good Right(B,5) B 5 Boys. A Good Boys B Good Morni,Boys. MidMid (A$,B,C)A$B CC Good Aftern D Good Morning A A 21 xx 3 A 0.01*Int(x+0.05) C 0.01*Int (100*(x+0.05)) B 0.01*Int (100*(x+0.005)) D 0.01*Int (x+0.005) B 22 Command13Label1 Label2 Label3 Private x As Integer Private Sub Command1_C1ick() Static y As Integer Dim z As Integer n=10 z= n+z y=y+z x=x+z Label1.Caption=x Label2.Caption=y Label3. Caption=z 3 3 A B C D x yzz y y z C 23 Command1 Private Sub Comma nd1_click() Static A As Integer Static B As Integer B=B+3 A=3+A

70 60 2 Print A,B 3 Command1 A 3 6 B 3 9 C 9 9 D 3 3 Command1 1 Command1 A B32 Command1 A B3 A B 6 3 Command1 A B 9 2Dim A As Integer 3 9 C 24 Command1 Private Sub Command1_Click() Static X As Integer Static Y As Integer Cls Y=1 Y=Y+5 X=5+X Print X,Y 3 Command1 A B 15 6 C D 5 6 X Y ClickY 1 5 X53 X15 Y6B B 25 True A C True Xor "1000" "999" B "1000" "999" D Xor False A False ASCII 1ASCII 9ASCII BTrue TrueFalseXorTrue

71 7 61 Xor False C DFalse B 26 Command1 Dim k As Integer Private Sub Form_Load() k=15 Private Sub Command1_Click() Static b As Integer b=b+k k=k+1 Print k b Command12 A B C D 2 1 kb Command1 b 150 b 31 k A 27 Private Sub Form_Click() Dim Strl As String, Str2 As String, Str3 As String Dim I A s Integer Str1 = "e" For I = 1 To 2 Str2 = UCase(Str1) Str1 = Str2 & Str1 Str3 = Str3 & Str1 Str1 = Chr(Asc(Str1) + I) Next I Print Str3 A EeFF B eeff C EEFF D eeff Asc(x)ASCII Chr(x) x ASCII Ucase(x) x

72 62 2 ForI=1Str2=E Str1=Ee Str3=Ee Str1=FI=2 Str2=F Str1=FF Str3=EeFF Str1=H EeFF A 28 Private Sub Form_Click() a$ = "*": b$ = "$" For k = 1 To 3 X$ = String$(Len(a$) + k, b$) Print X$; Next k Print A *** ** **** B *$*$*$ C 1*$2*$3*$ D $$$$$$$$$ For 9$ Len(Str) Str String$(n,ChA) n Cha D 29x Private Sub Command1_Click() Dim n As Integer,x As Integer,I As Integer x = 5 For I = 1 To 20 Step 2 n = I \ 5 x = x + n Next I A 21 B 22 C 23 D 24 \For x =21 A 30 Name Form1 Name Text1 Text2 Name Command1 Private Sub Command1_Click() a=text1.text+text2.text Print a Private Sub Form_Load()

73 7 63 Text1.Text="123" Text2.Text ="321" A 444 B C D Text1.Text Text2.Text C 31 Private Sub Text1_KeyPress(KeyAscii As Integer) Dim Char As String Char=Chr(keyAscii) KeyAscii=Asc(Ucase(char)) Print String(6,KeyAscii) A A a B A C aaaaaa D AAAAAA D Asc(x) ASCII Chr $ (x) x ASCII String $ (n, "") n D Fix( 48.65)+Int( 52.15) Fix Int Fix( 48.65)48 Int( 52.15)53 Fix( 48.65)+Int ( 52.15) a=2 b=3 c=4 d=5 Not a<=c Or 4* c=b^2 And b<>a+c Not And Or Not a <= c Or 4 * c = b ^ 2 And b <> a + c

74 64 2 True False True False False False False 3 Text1 C Val C=Val(Text1.Text) C=Val(Text1.Text) Print day (now) <cr> nowday(now) ABC abc ABCDE afgh ASCII afgh 6A AbcDeA Ucase Lcase A=Ucase$(A) 7ABCD Private Sub Command1_Click() a="" For n=65 To 68 a=a+ Next n Print a A B C D ASCII Chr() (ASCII) a ABCDChr$(n) Chr$ (n)

75 Private Sub Command1_C1ick() For i = 1 To 20 x = I nt( * ) If =0 Then Print x S=S+ End If Next i Print "Sum=":S Rnd() Rnd(n) n x Mod 5Int(x/5) x/5 x

76 Print Print [.]Print [][ ] Print Print Print 2. Print Tab Spc Space$ 1 Tab(n) n Print Tab 1nn nn 1 PrintTabTab 2 Spc(n) Print ntab PrintSpc SpcTab 3 Space$(n) n

77 8 67 3Format$ Format$ Format$( ) Str$ 4 InputBox InputBox(prompt[,title][,default][,xpos,ypos][,helpfile,comtext]) prompt title default xpos ypos helpfile comtext InputBox InputBox MsgBox MsgBox MsgBox(msg[,type][,title][,helpfile,context]) msg type title helpfile context InputBox

78 FontNameWindows FontSize 9 FontBold True FontItalic True FontUnderlineTrue Print Printer Printer.Print [] Printer Page NewPage EndDoc 2 PrintForm [.]PrintForm PrintForm AutoRedraw True PrintForm

79 Print "Worker";Spc 3 ; "Peasant" A Worker Peasant C WorkerPeasant B WorkerPeasant D WorkePeasant Spc(n)n PrintC C 2 Print Format $(32556, # # # # # # # );Format$(32556, # # # ) A B C D Format ## # 0 A 3 a=inputbox("today","tomorrow, "Yesterday","Day before yesterday",5) A Today B Tomorrow C Yesterday D Day before yesterday InputBox InputBox(prompt[,title][,default][,xpos,ypos][,helpfile,context]) default Yesterday C 4 age=inputbox(" "," ","38") 20 A age 20 C 38 B D Inputbox 73 B C DInputBox A A 5 x=inputbox("" "0" "")10

80 70 2 A X 10 C 0 BInputBox D X"10" InputBox 30 4 D D 6Temp=MsgBox(" ",vbyes No, " ") A B vbyesno C D Temp MsgBox3 C C 7Command1 Private Sub Command1_C1ick() a$="software and hardware" b$=right(a$,8) c$=mid(a$,1,8) Msgbox a$,,b$,c$,1 A software and hardware B software C hardware D 1 MsgBox MsgBox(prompt[,buttons][,title][,helpfile,comtext]) title b$hardsoft C 8 Temp=MsgBox(" ",vbabortretryignore, "") A 1 B 2 C 3 D 4 2 vbabortretryignore 3 C 9

81 8 71 Private Sub Command1_Click() MsgBox Str( ) A B 123 C 246 D MsgBox Str( ) 246 C 10 Private Sub Command1_Click() Dim a 5 As String Dim b As Integer Dim I As Integer For I =0 To 5 a(i)=i+1 Print a(i); Next I A B 6 C D 0 a A A 11 List1 Private Sub Form_Click() For I = 0 To List1.ListCount 1 If I Mod 2 = 0 Then Print List.List(I); End If Next I End sub Private Sub Form_Load() List1.Additem "" List1.Additem "" List1.Additem "" List1.Additem " " List1.Additem " "

82 72 2 A C B D Form_Load 5List 0Form_Click2 C 12 Private Sub Command1_Click() Dim MyString As String Dim MyLen As Integer MyString = "Hello World" MyLen = Len(MyString) MsgBox MyLen A Hello World B HelloWorld C 10 D 11 Len() D 13 Command1 Private Sub Command1_Click() Static A As Integer Static B As Integer Cls B=2 B=B+3 A=3+A Print A,B 3 Command1 A 3 5 B 6 6 C 9 5 D 3 3 Command1 A B 3 5Command1A BA 3 B 5 B 26 5 Command1 9 5 Command1Cls 9 5

83 8 73 C 14Command1 Private Sub Command1_Click() For I=1 To 4 For J=0 To 1 Print Chr$(65+I); Next J Print Next I A BB B A C B D AA CC BB CC BBB DDDD CCC DDD CCCC EEEEE DDDD EEEE DDDDD PrintFor Print Print For j i Chr$(65)="A" A 15 Private Sub Command1_Click() x = InputBox(" ") For I = 1 To Len(x) \ 2 If Mid(x, I, 1) <> Mid(x, Len(x) I + 1, 1) Then Exit For End If Next I If I > Len(x) \ 2 Then Print "Yes" Else Print "No" End If Ax Cx Bx Dx Len(x) x Mid(x,i,1)<>Mid(x,Len(x) i+1,1)

84 74 2 C 16 Private Sub Command1_Click() For i=1 To 5 For j=1 T i For k=j To 4 Print "a"; Next k Print Next j Print Next i A 4 B 5 C 38 D 40 i=1 4 i=2 7 i=3 9 i=4 10 i= =40 D Print Int( * )/

85 8 75 Private Sub Command1_Click Dim Password As String Password=Text1.Text If Password="myname" Then Form1.Show Else D=MsgBox( ) End If Refresh Private Sub Command2_Click() PasswordChar Command1 Default MsgBox MsgBox([,][, ][,]) EndUnLoad Me Command1 Default True PasswordChar * Unload Me " " vboknly "" End Text1 * True

86 Private Sub Command1_Click() Dim b(3,3) For i=1 To 3 For j=1 To 3 k=k+1 B(i,j)=k Print b(i,j ); Next j Next i For i= For j= Print b(i,j); Next j Next i Print 3 To 1 Step 1 Print Print 3 To 1 Step 1 3 To 1 Step 1 4 Command1 Private Sub Command1_C1ick() Dim a As String a= For i =1 To 5 Print Space(6 i);mid$3(a,6 i,2*i 1) Next i Space Mid

87 8 77 " " " " 5 3Textl Text2 Text3 Command1 Private Sub Command1_Click() Dim d As Single d = If d > =0 Then Text2.Text = *d Text3.Text = *(d/2)^2 End If d Text1.TextVal() Val(Text1.Text) Private Sub Command1_Click() For j = 1 To 3 Print ; 11*(2*j 1); Next j Tab(n) n Tab Tab(3*j)

88 Caption 1 Alignment0 1 2 AutoSizeTrueCaption BorderStyle Click DblClick 2 1 Text MaxLength0 Locked False True PasswordChar

89 9 79 MultilineTrue False ScrollBars Multiline True SelStart SelLength SelText 2 Change KeyPress LostFocus GotFocus 3 SetFocus [.]SetFocus PictureBox JPEG GIF PictureBox AutoSize True PrintClick DblClickPrint Cls 2 Image ImagePictureBox PictureBox PictureBox StretchImage ImageClick DblClickPrint Cls 2 Picture

90 80 2 LoadPicture [.]Picture = LoadPicture(" ") 3 1 Line BorderWidth BorderStyle X1 X2 Y1 Y2 2 Shape Shape FillStyle FillColor FillStyle Click SetFocus DefaultTrue Style0 Caption 1 Picture Picture.bmp.ico Value0 1 2 Alignment 0 1 Style 01 Click

91 List0 Listindex1 ListCount0List- Count 1 Sorted text MultiSelect 30 None 1 Simple2 Extended Selected 2 Click DblClick 3 AddItem RemoveItem Clear 2 1 Style Click DblClickstyle 1 ChangeStyle 0 1 3

92 Value Max Min LargeChangeValue SmallChangeValue 2 Change Scroll Name EnabledIntervalms 65s 2. Interval timer Font FontSize FontName FontColor Visible Name Enabled Caption Tab 1 Enabled VisibleTrue GotFocus LostFocus

93 9 83 SetFocus LoadShow 2 Tab Tab Tab Tab Tab Tab Disabled Invisible Tab TabStop False Tab TabIndex Tab Change A C B D D 2 True A WordWrap B MultiLine C ScrollBars D Locked 4 WordWrap 3 MultiLine True ScrollBase LockedFalseTrue B 3Esc Click True A Value B Default C Cancel D Enabled

94 Cancel Esc 3 Default True Click Enabled TrueFalse Value Cancel Esc Click C 4* A Text * C Password B Caption * D PasswordChar * PasswordChar TextBox D 5Text1 A Tex1.Enabled=False Text1.Alingment=0 C Tex1.Enabled=False Text1.Alignment=1 B Tex1.Enabled=True Text1.Alignment=0 D Tex1.Enable=False Text1.Alignment=2 EnabledTrue Alignment 01 2 D 6 A Change B KeyPress C LostFocus D SetFocus Change KeyPressLostFocusSetFocus D 7 A B C D

95 9 85 B 8 Pic1 temp1.bmp A Pic1="temp1.bmp" C Pic1.Picture="temp1.bmp" B Pic1.Picture=LoadPicture("temp1.bmp") D Pic1=LoadPicture("temp1.bmp") LoadPicture.Picture=LoadPicture(" ") 4 B B 9Form1 Image1 Private Sub Form_Load() Image1.Stretch=True Private Sub Image1_Click() Image1.Height=3000 A Image1.Picture=LoadPictrue("gg1.gif") Image1.Stretch=True B Image1.Picture="gg1.gif" Image1.Stretch=Not Image1.Stretch C Image1.Picture=LoadPictrue("gg1.gif") Image1.Stretch=Not Image1.Stretch D Image1.Picture="gg1.gif" Image1.Stretch=True LoadPicture Image1.Picture= LoadPicture("gg1.gif") StretchTrue FalseStretch Image1.Stretch=Not Image1.Stretch C

96 A Autosize C AutoRedraw B Stretch D Appearance 4 C D Picture AutoSize ImageImage Stretch Picture B B 11 A Caption B Value C Checked D Selected Caption Checked SelectedValue ValueTrue B 12Option1 Option2 Check1Text1 Text A Option1.Value=True Check1.Value=False C Option2.Value=False Check1.Value=True B Option1.Value=True Check1.Value=True D Option1.Value=True Check1.Value=1 Value Option ValueTrue Flash Check Value0 12 D D

97 OptionButton AFrame Image B ComboBox Image C ComboBoxPictureBox DFramePictureBox Visual Basic D 14List1 A List1.Clear B List1.Delete List1.ListIndex C List1.RemoveItem List1.ListIndex D List1.Clear List1.ListIndex B DeleteClear RemoveItem0 ListIndex C C 15 A List B ListCount C ListIndex D Columns List ListCount ListIndexColumns A 16List List1.RemoveItem List1.ListIndex A 123 B 456 C 789 D ListIndex 1 RemoveItem ListIndex

98 88 2 1RemoveItem D 17 List1 A List.Sorted=0 B List.Sorted=True List.MultiSelect=0 List.MultiSelect= 0 C List.Sorted=True D List.Sorted=True List.MultiSelect=1 Sorted True MultiSelect 0 None 1 Simple 2 Extended Ctrl Shift Shift D 18 List1Label1 A Private Sub List1_Click() B Private Sub List1_C1ick() Label1.Caption=List1.ListIndex Label1.Name =List1.ListIndex C Private Sub List1_Click() D Private Sub List1_Click() Label1.Name=List1.Text Label1.Caption =List1.Text Caption Name Text ListIndex D D 19 Private Sub Command1_Click() List.RemoveItem 2 Private Sub Form_Load() List.MultiSelect=2

99 9 89 List1.AddItem"" List1.AddItem"" List1.AddItem"" List1.AddItem"" Command1 A B C D Form_Load 4 0 3Command12 C 20 A Max B Large Change C Value D Max Min A 21Timer3Interval A 3 B 30 C 300 D 3000 IntervalTimer D 22 TxtTimeTimer1 Private Sub Timer1 () TxtTime.Text=Time A Enabled B Visible C Interval D Timer D 23HScroll1 LargeChange =5 SmallChange=3 Max=100 Value=45 Value

100 90 2 A 45 B 48 C 50 D 65 Value5C Value Max Min LargeChange Value SmallChangeValue C 24 ShapeFillStyle FillColorBackColor AShape FillStyle 2 7 BackStyle 1 BShape FillStyle 0 1 BackStyle 1 CShape FillStyle 2 7 BackStyle 0 DShape FillStyle 0 1 BackStyle 0 Shape FillStyle0 7 0FillColor Shape BackStyle0 1 0 TransparentBackColor 1 Opaque BackColor A A Text1 Text2 Command1Command1Text2

101 9 91 Private Sub Command1_Click() Text2.SelStart=0 Text2. =Len(Text2.Text) Text2. 3 SelStart SelLength SelText SelStart SelLength SelText SetFocus SelStart0 SelLength SelLength SetFocus SelLength 2 Command1 Text1 Command1 Command1 SetFocus Private Sub Form_Load() Command1.Enabled=False Private Sub Text1 () Command1.Enabled=True Change 3 Private Sub Form_Load() Text1.Text=" " Private Sub Text1_Change() Picture1.Print"" Picture1.Print ""Text1 Change

102 Stretch StretchTrue AutoSize True True 6d:\pic a.jpg Picturel Picture1.Picture=LoadPicture("d:\pic\a.jpg") 7 Interval 8 Timer 9 Timer1 Label1 30 Label1100 Priv ate Sub Form_Load() Label1.Left=Form1.Width Timer1.Interval=30 Timer1.Enabled=True Private Sub Timer1_Timer() Label1.Left= Label1.Left 100 If Label1.Left<100 Then End If Form_LoadLabel1 Left Timer1.IntervalTimer 30 Timer1.Enabled True Timer1.Timer Left 100 EnabledFalse

103 9 93 Timer1.Enabled=False LargeChangeValue LargeChange 11Form1 Click Caption Caption Label1.Caption="Visual Basic " Caption Label1 Visual Basic 12OKCmdOK_Click() Caption Click()Caption CmdOK OK 13 ListBox1 Private Sub Command1_Click() Dim Entry,I,Msg Msg="Choose Ok to add 100 tiems to your list box" MsgBox Msg For I =1 To 100 Entry="Entry"& I ListBox1.AddItem Entry Next I AddItem AddItemListBox Label1 List1 Label1 Private Sub Form_load() List1.AddItem "" List1.AddItem ""

104 94 2 List1.AddItem "" Private Sub () Label1.Caption= List1_DblClickListBoxText List1.Text Label1.Caption List1_DblClick List1.Text 15 Visual Basic 16 Value Value=1 Value 17(mnuEditCopy) mneditpaste Private Sub mnueditcopy Click() mneditpaste. =True Enabled Visible Enabled Visible Text1 Text2 Enabled 18 Text1 Text2 Private Sub Text1 () Text2.Text=Text1.Text Change

105 9 95 Text Text Change 19 Label1 Command1 Timer1 1 1 Private Sub Form_Load() Timer1.Interval= Private Sub Timer1_Timer() Label1.Caption=Now Private Sub Command1_Click() End Timer1.Interval Private Sub Form_Click() Dim Msg As Integer Form1. MsgBox "Choose OK to make the form reappear" Form1. HideShow Hide Show 213Label1 Text1 HScroll1Label1 Label1 Left Private Sub Form_Load( ) HScroll1.Max=Form1.Width HScroll1.Min=0 HScroll1.LargeChange=50 HScroll1.SmallChange=10 Text1.Text=HScroll1.Value HScroll1.Value=0 Label1.Left=HScroll1.Value Private Sub HScroll1 Text1.Text=HScroll1.

106 96 2 Label1.Left=HScroll1.Value Label1 Change Label1 ChangeValueLabel1 Left Change() Value 22 Label1 Label2 Caption HScroll1Min0 Max100 Label2 Private Sub HScroll1 () Label2.Caption=HScroll1. Change Change() ChangeValue Caption Value Change Value 23 3 Picture DownPicture DisabledPicture DownPicture

107 If Then [Else ] True ThenElse 2 If 1 Then 1 ElseIf 2 Then 2 Else n+1 End If 3 IIf IIf(,, ) Select Case Case 1 1 Case 2 2 Case Else n End Select For For

108 98 2 For = To [Step ] [Exit For] Next Exit For Next While [ ] Wend Do 1 Do [{While Until}<>] [Exit Do] Loop 2 Do [Exit Do] Loop [{While Until}<>] 12 While Until {While Until}<>Do LoopExit Do Exit Do Loop

109 GoTo 1 GoTo Go To { } Go To 2 On-GoTo On GoTo For I= To 10 Step 0 k=k+2 Next I A C B D 0 A 2x x=3 For I=1 To 20 Step 2 x = x + I / 3 Next I A 3 B 22 C1 D 4 For 2 x 3 A

110 Command1: Private Sub Command1_Click() x=0 n=inputbox("") For i= 1 To n For j = 1 To i x = x +1 Next j Next i Print x 3 A 3 B 4 C 5 D 6 36 D 4 sum=0 For I =11 To 1 Step 2 sum=sum+i Next I Print I sum=sum+i I A 73 B 61 C 63 D 71 For I3 A 5 Command1 Label1 Private Sub Command1_C1ick() S=0 For i=1 To 15 x=2*i 1 If x Mod 3=0 Then s=s + 1 Next i Label1.Caption=s

111 A 1 B 5 C 27 D B B 6 Private Sub Sele() Dim n As Integer i=21:n=3 Do While i > n i = i n Loop Print i A 3 B 5 C 6 D 8 While i 3i3 A 7 Private Sub Command1_Click() For i = 1 To 3 For j =5 To 1 Step 1 Print i + j Next j,i End Sud A 12 B 13 C 14 D =15 D 8 n! A Private Sub Command1_Click() n=5:x=1 Do x=x*1 i=i+1 Loop While i n Print x B Private Sub Command1_Click() n=5: x=1:i=1

112 102 2 Do x=x * 1 i=i + 1 Loop While i n Print x C Private Sub Command1_Click() n=5:x=1:i=1 Do x=x * 1 i=i + 1 Loop While i<=n Print x D Private Sub Command1_C1ick() n=5:x=1:i=1 Do x=x * 1 i=i + 1 Loop While i n Print x Do Loop WhileWhile C C 9Command1 Option Base 1 Private Sub Command1_Click() Dim a(5) As Integer Dim K As Integer Dim Total As Integer a(1)=2 a(2) =5 a(3) =4 a(5) = 6 For k = 1 To 5 Total = Total + a(k) Next k Print Total A 10 B 15 C 27 D 35

113 =27 C 10 Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1 To 3 x = 3 For k = 1 To 2 x =x+6 Next k Next j Next i Print x A 7 B 15 C 157 D 538 x=33+6+6=15 B 11 Exit For A Exit For B C Exit For D For Exit For For Exit For D 12 x Private Sub Command1_Click() Dim a As Single, b As Single, c As Single, d As Single Dim x As Single a=100 b=20 c=1000 x=a If b>a Then d=a:a=b:b=d End If If b>c Then

114 104 2 x=b Else If a>c Then x=c A 100 B 20 C 1000 D 0 If If x=ax=100 A 13 Text1Command1 Private Sub Command1_Click() Dim i As Integer,n As Integer For i = 0 To 50 i = i + 3 n = n + 1 If i>10 Then exit for Next Text1.Text = Str(n) A 2 B 3 D 4 D 5 For i Ifi10 10 For 1 i=3 n=12i=7 n=23i=11 n=3 i B 14 Private Sub Command1_Click() Dim I,Mynum Do For I=1 To 1000 Mynum=Int(Rnd*1 000) Select Case Mynum Case 7: Exit For Case 29: Exit Do End Select n=n+1 Next I Loop

115 Print n A 7 C1000 B Do D 0029 Do Loop Exit Do Rnd 0,1Int() D 15 Text1 Text2Command1 Private Sub Command1_Click() Dim x As Integer,n As Integer x=1 n=0 Do While x<20 x=x*3 n=n+1 Loop Text1.Text=Str(x) Text2.Text=Str(n) A 15 1 B 27 3 C D Do While Loop 1x=3 n=12x=9 n=23x=27 n=3x B 16 Private Sub Command1_Click() For I=1 To 4 X=0 For j=1 To 3 X=j For k=1 To 2 X=x+6 Next k Next j Next I Print x

116 106 2 A 7 B 15 C 157 D 538 x=j x=3+6+6=15 B 17 n Private Sub Command1_Click() n=0 For i=1 To 100 If i Mod 4=0 Then n=n+1 Next i Print n A 5050 B 25 C 26 D 33 If /4=25 B 18 2 Private Sub Form_Click() Dim N1 As Integer, N2 As Integer,N3 As Integer N1=1:N2=2 Print N1,N2 Do N3=N1+N2 Print N3; N1=N2:N2=N3 Loop Until N3>=5 A B C D Do Loop Until Until TrueN1 N N3 2 2 N1 1 N2 2 2>=5 False 2 N3 3False3 N3 5True B 19Command1

117 Private Sub Command1_Click() Dim a As Integer,y As Integer a=10:y=0 Do a=a+2:y=y+a Print "a=";a, "y=";y If y>20 Then Exit Do Loop Until a>14 A a=12 y=12 B a=12 y=12 a=14 y=16 a=16 y=28 C a=12 y=12 D a=12 y=12 a=14 y=26 a=14 y=44 a10 y0 Do Loop a=a+2:y=y+aa 12 y 12a=12 y=12 IF y>20 False Exit Do a>14 False a=a+2:y=y+aa 14 y 26a=14 y=26 IF y>20 True Exit Do C 20 Private Sub Command1_Click() Dim s As Integer, n As Integer s=0 : n=1 Do Until n>100 s=s+n n=n+1 Loop Print s A 5050 B 2500 C 3000 D 4000 Do Until Loop Until s s= =5050 n A 21Command1 Private Sub Command1_Click() Dim I As Integer, a As Integer Do While I<20 Do While True

118 108 2 If I Mod 10=0 Then Exit Do Else I=I 1 End If Loop I=I+11 a=a+i Loop Print a A 21 B 32 C 33 D 11 I<20I Mod 10=0 B Private Sub Command1_Click() For m=1 To 10 Step 2 a=10 For n=1 To 10 Step 2 a=a+2 Next n Next m Print a a=10 a a=10a S S=5 For i =2.6 To 4.9 Step 0.6 S=S+1 Next i S 9

119 Dim t As Single, k As Single k=0 While k<10 k=k+1 Wend Print t k 0k<10 1t t=t+k t=t+k 4 3 Private Sub Commandl_Click() k =10 Do x = k x = x 2 k = k 1 Loop While k >1 MsgBox x k 10 1 k=0x= a=100 Do Print a a=a+1 Loop Until a <=10 a<=10 a100 1 a<= /3+1/5+ +1/(2n+1) 1/(2n+1)10 4

120 110 2 Private Sub Command1_Click() Sun = 0 : n = 1 Do n= term = 1/ n Sum = Sum +term If term Then Loop Text1.Text = n Text2.Text = Sum Do Loopterm< Exit Do n+2 n+2 Exit Do 7 Private Sub Form_Click() Dim x As Single,amax As Single,amin As Single x=inputbox("enter a score") amax=x amin=x Do While If x>amax Then Amax=x End If If Then Amin=x End If x=inputbox("enter a score") Print "Max=";amax, "Min=";amin x>=0 IfIf x<amin x>=0 x<amin Private Sub Form_Click() Dim I As integer

121 Dim K As integer For I=100 to 999 For K=2 To I-1 If Then End If Next K If then Print I End If Next I I I2 I 1 I IK 2 I 1 I KI Mod K=0I I Exit For Exit For KI K=I I Mod K=0 Exit For K=I 9 Command1 Function M(x As Integer,y As Integer)As Integer M=IIf(x>y,x,y) End Function Private Sub command1_click() Dim a As Integer,b As Integer a=100 b=200 Print M(a,B MIIf M

122 Dim 1[,2][,3] [As ] 0 Option Base 2 ReDim Dim Private Public ReDim For InputBox Print

123 ForEach Next For Each In [Exit For] Next [] 3 Array = Array( ) Variant3 Variant Array text1(0) text1(1) text1(2) m ninteger 1 Dim Arty(m,n) As Integer 3 Print A=A+B;A+B 2 n= Chdrive c: A 1 B 2 C 3 D 4 1Print 3Chdrive 4 C

124 Dim Arrl ( 2 to 6) As Integer A 6 B 7 C 8 D 9 +1 Arrl6 ( 2)+1=9 D 3 Option Base 1 Dim Arr4(6,5) As Integer A 42 B 30 C 37 D 36 Option Base 1 Dim Arr4(6,5) As Integer Dim Arr4(1 to 6,1 to 5) As Integer 30 B 4 Option Base 0 Private Sub Form_Click() Dim a Dim i As Integer a=array(1,2,3,4,5,6,7,8,9) For i=0 To 3 Print a(5 i) Next A B C D Option Base 00 a=array(1,2,3,4,5,6,7,8,9) a(0) a(8) 1 9 For a(5) a(2) C 5Command1 Option Base 0 Private Sub Command1_Click() Dim city As Variant city = Array("","","","") Print city(1)

125 A B C D Option Base Array0 D D 6 Command1 Option Base 1 Private Sub Command1_Click() Dim I As Integer For I=1 To 3 For j=1 To 3 X(I,j)=(I j)*3+j Next j Next I For I=1 To 3 Print x(i,4 I) Next I A B C D For 3 3X 1 3For3 X(1,3) X(2,2) X(3,1) X(1,3)=(1 1) 3+3=3 X(2,2)=(2 1) 3+2=5 X(3,1)=(3 1) 3+1=7 C 7 Text1Command1 Private Sub Command1_Click() Dim array1(10,10) As Integer Dim i,j As Integer For i=1 To 3 For j=2 To 4 array1(i,j)=i+j Next j Next I Text1.Text=array1(2,3)+array1(3,4)

126 116 2 A 12 B 13 C 14 D 15 array1(2,3)+array1(3,4)= =12 A 8 Command1 Private Sub Command1_Click() Dim I As Integer, a(9) As Integer For I=9 To 0 Step 1 a(i)=10 I Next I Print a(2);a(5);a(8) A B C D a10 a(0) a(9) For10 a(0) a(9) 10 1a(2) a(5) a(8) C 9Command1 Private Sub Command1_C1ick() Static b As Variant b=array(1,3,5,7,9) b A For i=0 To 5-1\2 B For i=0 To 5 tmp=b(i) tmp=b(i) b(i)=b(5 i 1) b(i)=b(5 i 1) b(5-i-1)=tmp b(5-i-1)=tmp Next I Next I C For i=0 To 5\2 D For i=1 To 5\2 tmp=b(i) tmp=b(i) b(i)=b(5-i-1) b(i)=b(5-i-1) b(5-i-1)=tmp b(5-i-1)=tmp Next I Next I For B(0 n 1) nb(0) b(n 1) b(1) b(n 1 1) b(i) b(n i 1) i=0 1 2 n\2forn\2

127 b(i) b(n i 1)C C 10 Private Sub Command1_Click() Dim MyWeek, MyDay MyWeek=Array("Mon","Tue","Wed","Fri","Sat","Sun") MyDay= MyWeek(2) MyDay= MyWeek(4) MsgBox MyDay A Sat B Tue C Wed D Thu 0 MyWeek(4)5 Sat A 11Form_Click3 Option Base 1 Private Sub Form_Click() Dim i As Integer, j As Integer a(5,5) As Integer For i=1 to 5 For j=1 to 5 If i=j Then a(i,j)=i+j Else If i>j Then a(i,j)=1 Else a(i,j)=0 End If End If Next j Next i For i=1 to 5 For j =1 to 5 Print a(i,j) Next j Print Next i A B C D a For a

128 a C 12 Command1 Private Sub Command1_Click() Dim i As Integer,j As Integer Dim a(10,10)as Integer For i=1 To 3 For j=1 To 3 a(i,j)=(i 1)*3+j Print a(i,j) Next j Print Next j A 123 B 234 C 147 D D D 13 Command1 Private Sub Command1_Click() Dim i As Integer, k As Integer Dim a(9) As Integer Dim p(2) As Integer k=5 For i =0 to 9 a(i)=i Next i For i =0 to 2 p(i)=a(i*(i+1)) Next i For i=0 to 2 k=k+p(i)*2 Next i Print k

129 A 20 B 21 C 22 D 23 a p For a a(0) a(9) 0 9 p p(0)=a(0*1)=0 p(1)=a(1*2)=2 p(2)=a(2*3)=6p2 kk 21 B 14 List1Command1List1 MultiSelect 2Command1 Private Sub Command1_Click() For I =List1.ListCount 1 to 0 Step 1 If =True Then List1.Removeitem I End If Next I A List1.select(i) B List1.sort(i) C List1.list(i) D List1.select(List1.listindex) Select TrueFalse Select True A 15 Type Student Num As Integer Name As Integer * 13 End Type Dim stu(30) As Student A C B D Type Student Num Name 30stu B 16Form1_Click Private Sub Form_Click()

130 120 2 Dim M As Integer, K As Integer,t As Integer M=6:K=8 Select Case M Case Is<0 M=M+5 Case 1 To 10 t=m:m=k:k=t Case Is >10 M=K Mod 3 End Select Print M, K, t A B C D Form_Click M K 6 8 Select Case M M 6 2 Caset=M:M=K:K=tt 6 M 8 K 6 D 17Command1 Option Base 1 Private Sub Command1_Click() Dim a As Variant a=array(1,2,3,4) j=l For I=4 To 1 Step 1 s=s+a(i)*j j=j*10 Next I Print s A 4321 B 1234 C 34 D =1234 B 18Form1_Click3 Option Base 1 Private Sub Form_Click() Dim I As Integer,j As Integer Dim k As Integer,a(5,5) As Integer For I=1 to 5

131 k=1 For j=1 to 5 If I<=j Then a(i,j)=k k=k+1 Else a(i,j)=1 End If Next j Next I For I=1 to 5 For j=1 to 5 Print a(i,j) Next j Print Next I A B C D For For a C 19 A BName C Index D Index D D 203 chkoption

132 122 2 A Tag B Index C ListIndex D Name A D C B B Dim Arr2( 2 to 6,1 to 5) As Integer Dim A (100)A Visual Basic0 Dim A(100)A Option Base 1 Dim Arr5(0 to 6,0 to 5)As Integer A 42 B 30 C 37 D 36 Option Base 1 1 0Arr5 (6 0+1) (5 0+1) =42 A 4 Private Sub Command1_Click() score = Int(Rnd*10)+80 Select Case score Case Is<60 a$ ="F" Case 60 To 69 a$ = "D" Case70 To79 a$="c" Case 80 To 89 a$="b"

133 Case Else a$ ="A" End Select Print a$ score Int(Rnd*10)+80 Rnd Select Case score Case Case 80 To 89 Casea$="B" B B 560 Option Base 1 Private Sub Command1_Click() Dim d 6 For i=1 To 60 n = d(n) = Next i For i = 1 To 6 Print d(i) Next i 1 6 Int(1+6*RnD) d d(n)+1 Int(1+6*RnD) d(n) Option Base 1 Private Sub Form_Click() Dim a(20) As Integer, i As Integer Dim t as Integer,j As Integer Randomize For i=1 to 20 a(i)=10+int(90*rnd Print a(i);

134 124 2 Next i Print i=1: Do while i<j t=a(i): :a(j)=t i=i+1:j=j 1 Loop For i=1 to 20 Print a(i) Next i Print i1j20 a(i) a(j) i j ij j j=20a(i) a(j) a(i)=a(j) j=20 a(i)=a(j) 7 Command1 Text1 Text24 Label1 Label2 Label3 Label Option1 + * / Text1 Text2 Label4 3 Private Sub Command1_Click() For i=0 To 3 If =True then opt=option1(i).caption End If

135 Next Select Case Case"+" Result=Val(Text1.Text)+Val(Text2.Text) Case" " Result=Val(Text1.Text) Val(Text2.Text) Case"*" Result=Val(Text.Text)*Val(Text2.Text) Case"/" Result=Val(Text1.Text)/Val(Text2.Text) End Select =Result Value True 1 Option(i).Value Select opt2optlabel4 3 Label4.Caption Option(i).Value opt Label4.Caption

136 Sub Sub 1 Sub 1 Sub Sub [Static][Public Private]Sub [()] 2 Sub 2 Sub Sub 1 Call [()] 2 [] Sub Function Sub

137 Function 1 Function Function [Static][Public Private]Function ([]) [As ] = End Function 2 Function ([]) 3 Sub Function Sub FunctionFunction Sub Function Function FunctionSub Sub Sub Function

138 ByDef 3. ByVal Optional IsMissing Variant ParamArray Sub ParamArray Variant Form Control

139 A Form_Load B CSub D 0 Form_Load Static A B D C C 2 A BPublic CDim DPublic Dim Visual Basic3/ /Private Dim Public B 3 A B C D C C

140 A B C D D D 5 Command1 Label1 Label2 Private x As Integer Private Sub Command1_Click() x=5:y=3 Call proc(x,y) Label1.Caption=x Label2.Caption=y Private Sub proc(byval a As Integer,ByVal b As Integer) x=a * a y=b + b A 5 3 B 25 3 C 25 6 D 5 6 xprivate YCommand1_Click() Proc x25 y 25 3 B 6 A Void play(var a:integer,var b:integer) B Sub play(int a,b) C Void play(int a,int B) D Sub play(a As Integer,b As Integer) Visual Basic Sub 4A Visual Basic Var Void B CInteger D D 7

141 A Static Static B Sub Sub C Sub Sub D Static Static Sub Sub Function Sub Sub Sub 4 D D 8 AShell Windows BShell Visual Basic C Shell < >=Shell() DShellDOS DOS Windows Shell com exe bat pie Shell Visual BasicShellB B 9 Option Base 1 Private Sub fun(a() As Integer,n As Integer) ReDim Preserve a(6) a(6)=a(1)*a(3)*a(5) n=ubound(a Private Sub Command1_Click() Dim arr1() As Integer,k As Integer ReDim arr1(5) For i=1 To 5 Arr1(i)=i Next i k=6 Call fun(arr,k) Print arr1(1); arr1(k)

142 132 2 A 1 3 B 0 0 C 1 15 D 0 15 Command1_Click arr1 5 Forarr1(1) arr1(5)1 5 funk6 funa6 a(6) 1 3 5=15Uboundnn 6 aarr1 nk arr1(1) arr1(6) 1 15 C 10 Command1 F1F1 F11 0 A Private Sub Command1_Click() x=inputbox(" ") a=f1(val(x)) Print a Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function B Private Sub Command1_Click() x=inputbox(" ") a=f1(val(x)) Print a Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=0 Else F1=1 End If End Function C Private Sub Command1_Click() x=inputbox( ) F1(Val(x))

143 Print a Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=1 Else F1=0 End If End Function D Private Sub Command1_Click() x=inputbox(" ") F1(Val(x)) Print a Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function Val(x)x ByRef Return b Mod 2=0b B B 11 Private Sub test(p, m, n) p = p + 1: m = m + 1: n = n + 1 Print "Sub:"; p; m; n Private Sub Command1_Click() a1 = 1: b1 = 2: c1 = 3 Call test(a1, b1 + 3, (c1)) Print "main"; a1; b1; c1 A Sub:26 4 B Sub C Sub: 26 4 D Sub: Main:26 4 Main: Main: 12 3 Main: 2 2 3

144 134 2 testa1 b1+3 (c1)testa1 b1 c1 D D 12 Command1 Text1 Private Sub Command1_Click() Dim x,y,z As Integer x=5 y=7 z=0 Text1.text="" Call P1(x,y,z) Text1.Text=Str(x) Sub P1(ByVal a As Integer,ByVal b As Integer,c As Integer) c=a+b A 0 B 12 C Str(z) D CallP1 c P1 z12 B 13 Private Sub func(a As Integer) Static m As Integer Dim n As Integer m=m+a n=n+a Print m; n Private Sub Command1_Click() Dim k As Integer k=4 Call func(k) Call func(k) A 4 8 B 4 4 C 4 4 D

145 Command1_Clickk4 funckafuncm n m n44 4func m 4n 0 m 8 n B 14 Dim a As Integer, b As Integer Private Function fun() Dim a As Integer a=5 Print a;b End Function Private Sub Command1_Click() b=5 Call fun Print a;b A 5 5 B 0 5 C 5 0 D a a bcommand1_clickb 5 func a5 a a b5 a b 0 5 A A 15 Option Base 1 Private Sub fun (a() As Integer, n As Integer) ReDim Preserve a (n) a(6)=a(1)+a(2)+a(3)+a(4)+a(5) n=3 Private Sub Command1_Click() Dim arrl() As Integer,k As Integer ReDim arrl(5) For i=1 To 5 arrl(i)=i Next i k=6

146 136 2 Call fun(arrl,k) Print arrl(i); arrl(k);arrl(6) A B C D Command1_Clickarrl 5 For arrl arrl(1) arrl(5) 1 5 fun arrlaknfun 6a(6) =15n3 a n arrl(1) arrl(5) 1 5arrl(6) 15 k 3 arrl(1) arrl(3) arrl(6) C 16Form_Click Option Explicit Private x As Integer Public y As Integer Sub Test() Dim y As Integer x=2:y=2 Print "x=";x, "y=";y Private Sub Form_Click() x=1:y=1 Test Print "x=";x, "y=";y A x=2 y=2 B x=2 y=2 C x=2 y=1 D x=2 y=1 x=2 y=1 x=2 y=2 x=2 y =2 x=2 y=1 x y x y1 Test y x2y2x y2 x 2 y 1A A 17 Private Sub fun(byval x As Integer, ByVal y As Integer,z As Integer) z=x^3*y^3 Private Sub Command1_Click() Dim a As integer

147 Call fun(2,3,m) Print m A 216 B 0 C 35 D Command1_Clickfun2 3 x y mz fun z=x^3*y^3z 216 m 216 A 18 Dim a As Integer Dim b As Integer Private Sub fun() a=100 b=200 Private Sub Command1_Click() Dim a As Integer a=5 b=7 Call fun Print a; b A B C D 5 7 a b Command1_Click aa a5 b7 funfun a b a b a5 b 200 B 19 Private Function fun3(x As Integer) Static a As Integer a=a+3 a=a+x fun3=a End Function Private Sub Command1_Click() Dim k As Integer,p As Integer k=2:m=1 n=fun3(k)

148 138 2 n=fun3(m) Print n A 6 B 7 C 9 D 12 Command1_Clickfun3k xfun3 aa 5 5 nfun3 5a 99n n9 C 20 Private Sub fun() Static a As Integer a=a+2 Print a Private Sub Command1_Click() Dim m As Integer For m=1 to 3 Call fun Next m A B C D Command1_ClickFor3 3 funfun aa fun a D 21Form_Click2 3 Private a As Integer, c As Integer Private Sub Form_Click() Dim a As Integer,b As Integer a=10 :b=10 :c=10 Print a,b,c Call test1(a,b Print a,b,c Private Sub test1(m As Integer,ByVal n As Integer) Dim c As Integer m=5:n=5:c=5 Print m,n,c

149 A B C D a cform_click a b test1 a m b ntest1cm 5 a5nc5 test a b c A 22 Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1=ucase(mid(s,i,1))+s1 Next i Fun=s1 End Function Private Sub Command1_Click() Dim Str1 As String,Str2 As String Str1=InputBox("") Str2=Fun(Str1) Print Str2 abcdefg A abcdefg B ABCDEFG C gfedcba D GFEDCBA FunLen(s) Mid(S,i,1) S i1 Ucase( ) s1abcdefg GFEDCBA D 23 Form1 Form2 mdlfunc Form1 Form2 mdlfunc Form1 Private Sub frmfunction1()

150 140 2 Form2 Public Sub frmfunction2() mdlfunc Public Sub mdlfunction() A 3 B frmfunction2 mdlfunction C 3 D mdlfunction PrivateA Public B PublicC D D Function fact(x As Integer) As Long Dim p As Long, I As Integer P=1 For I=1 To x p=p*i Next I fact=p End Function Private Sub Command1_Click() i=val(input Box(" "))

151 a=fact((i)) Print a 5 fact(x)x!5 fact = Private Sub Command1_Click() a = 1: b = 1 Print "a="; a, "b="; b Call mult((a), B) Print "a="; a, "b="; b Sub mult(x, y) x = 2 * x y = 3 * y Print "x="; x, "y="; y 5 Print 1 a 2 b a 1b 35 Printa=1 b=3 a=1 b=3 3 Private Sub Search(a() As Variant,ByVal key As Variant,index%) Dim I% For I=LBound(A)To UBound(A) If key=a(i) Then index=i Exit Sub End If Next I index= 1 Private Sub Form_Load() Show

152 142 2 Dim b() As Variant Dim n As Integer b=array(1,3,5,7,9,11,13,15) Call Search(b,11,n) Print n fact Private Sub Command1_Click() For k = 1 To a = LTrim(Str(k)) n = 0 For i = p = Val(Mid(a, i, 1)) n = Next i If n = k Then Print k Next k Function fact(x) If x <= 1 Then fact = 1 Else fact = End If End Function For1 To Len(A) fact n+fact(p) x * fact(x 1) 1 To Len(A) n+fact(p) x * fact(x 1) Private Sub Form_Click() Dim s As Long,I As Integer s=0 For I=1 to 10

153 s=s+ Next I Print s Private Function fact(byval n As Integer) As Long Dim i As Integer,f As Long f=1 For i=2 To n f=f*i Next i End Function Form_ClickFor 1 10 s factifact(i) fact For2nf fnvisual Basic fact=f fact(i) 6 fact=f Private Sub Form_Click() Dim a As Integer,b As Integer a=20:b=50 p1 a,b p2 a,b p3 a,b Print "a=";a,"b=";b Sub p1(x As Integer,ByVal y As Integer) x=x+10 v=v+20 Sub p2(byval x As Integer, y As Integer) x=x+10 y=y+20 Sub p3(byval x As Integer, ByVal y As Integer) x=x+10 y=y+20 a= b= ByVal ByRef 30 70

154 KeyPress KeyPress ASCII KeyPress KeyPressIndex As Integer KeyAscii As Integer KeyAscii KeyPressKeyAscii ASCII KeyPress KeyAscii KeyPress KeyAscii KeyDown KeyUp KeyDown KeyUp KeyDown KeyUpKeyPress KeyDown KeyUp KeyPress ASCII KeyDown KeyUp Index As IntegerKeyCode As Integer Shift As Integer MouseDown MouseUp MouseMove Button Shift x y 2 Button Button

155 Shift Button Shift ShiftCtrlAlt88 4 x y WindowsVisual Basic MousePointer MousePointer DragMode Click MouseDrown DragIcon 2 DragDrop DragOver 3 Move DragDragMode 01 2DragDrop

156 146 2 AKeyUp KeyDownA a KeyCode BKeyUp KeyDown 11 KeyCode C KeyPress D KeyPress 3 KeyPress ASCII Shift ASCII KeyUp KeyDown 4C C 2 Text1ASCII A KeyDown B Change C KeyUp D KeyPress 4 KeyDown KeyUp Keycode Change KeyPressKeyASCIIASCII D 3 A A KeyDown KeyPress KeyUp Change B KeyDown KeyPress KeyUp Change C KeyDown Change KeyUp KeyPress D KeyPress Change KeyDown KeyPress Change KeyUpChange A 4 A 4 Txta Private Sub Txta_KeyPress(KeyAscii As Integer)

157 KeyPress A C B D 4 KeyPress D 5 Ctrl a Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print KeyCode,Shift A a 2 B 65 2 C 97 1 D 97 2 KeyDownKeyCode Shift KeyCode a65 Shift Shift Ctrl Alt Shift Shift0 1Ctrl Shift1 1 Alt Shift2 1 Ctrl Shift 2 B 6KeyDown KeyPress Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Private Sub Text1_KeyPress(KeyASCII As Integer) A KeyDownKeyCode KeyPressKeyASCII B 11 KeyCode C KeyCode D KeyASCII KeyDownKeyCode KeyPress KeyASCIIASCII

158 148 2 KeyASCIIC C 7 MouseDown Private Sub Form_MouseDown(Button As Integer,Shift As Integer, X As Single,Y As Single) A Button B Shift C X D Y MouseDown4Shift 3 Button A 8 A DragMode B DragOver C DragDrop D DragIcon DragMode10 DragOverDragOver DragDrop Drag DragDrop DragIcon Icon Cur A 9 A Move CLeft B DTop Move LeftTop B B 10MouseIcon

159 MousePointer A 0 B 1 C 64 D 99 MousePointer MouseIcon D 11 Private Sub form MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If Shift=6 And Button=2 Then Print "BBBB" End If BBBB A Shift C Ctrllt B Shift D Ctrl Alt MouseDown Button Shift Button Shift 30Shift 1Crtl 2Alt 6110CtrlAlt D D 12 Private Sub Form_MouseDown(Button As Integer,Shift As Integer, X As Single,Y As Single) If Button=2 then PopupMenu popform End If A B popform C X Y D Button=2

160 150 2 Button12 4 D D Command1_Click Command1 True Default Default 2MousePointer MouseIcon MousePointer Text1 2 Text2Tab Private Sub Text1_KeyDown(Keycode As Integer, Shift As Integer) If Then Text2. End If Text2 SetFocus Text2 KeyDownKeyCode 13KeyCode=13 SetFocus KeyCode=13 SetFocus 4 KeyPress KeyDown True KeyPress KeyPreviewTrue KeyPress KeyUp KeyDown KeyPreview 5 Combo1Label1 Label2 Caption ASCII13 Label2 Label2 3

161 Private Sub Combo1 (KeyAscii As Integer) If KeyAscii=13 Then For i=0 To Combo1.ListCount 1 If Combo1.Text= Then Label2.Caption=" " Exit Sub End If Next i Label2.Caption="" Combo1. Combo1.Text End lf KeyPress List List AddItem KeyPress Combo1.List(i) AddItem 6 0 Drag 0 21 DragMode01 Drag DragMode

162 EnabledTrue False 2 OnOff CheckedTrue False 3

163 Alt & Caption Caption PopupMenu PopupMenu PopupMenuMouseDown Button A BVisible False C - D Visible True Enabled False Checked True Visible True - C

164 154 2 C 2 A B & CVisible D Caption Name A 3 MenuItem1 A MenuItem1.Caption=" " C MenuItem1.Enabled=True B MenuItem1.Checked=True D MenuItem1.Visible=True Caption Checked True Enabled True VisibleTrue B 4 A B Enabled False C D BEnabledFalse B 5MenuItem1E dit A MenuItem1.Caption=" \E dit" B MenuItem1.Caption=" &E dit"

165 C MenuItem1.Caption=" >E dit" D MenuItem1.Caption=" <>E dit" Caption & B B 6menu1 A Menu1.Enabled=True C Menu1.Visible=True B Menu1.Enabled=False D Menu1.Visible=False Enabled VisibleEnabled Visible D 7 pl Visible False Form1 A Popup pl B Forml.Popup pl C pl.popup D Popup Forml.pl Visible FalsePopup.Popup B B Visual Basic 2Visual Basic 3Unload Unload Enabled Visible 4 Click

166 Pmenu Form1. Pmenu Visible False PopupMenu PopupMenu

167 ActiveVisual Basic Help DefaultEXT Dialog FileName FileTitle Filter Filter Index Index Flags InitDir MaxFileSize CancelError HelpCommand HelpContext HelpFile HelpKey Color FlagsFlags Flags Flags FontBold FontItalic FontName FontSize FontStrikeThru FontUnderline Max Min Flags Copies Flags FromPage ToPage hdc Max Min PrinterDefault Flags

168 A B ShowOpen ShowSave C ShowOpen D ShowColor CommonDialog Timer C C 2 A FileName B Filter C FilterIndex D InitDir FileName Filter FilterIndex InitDir B 3.txt A "text (.txt) (*.txt) " B "(.txt) (.txt) " C "text(.txt) (*.txt) " D "text(.txt)(*.txt) " Filter

169 description1 filter1 description2 filter2 A A 4Cdlg A Cdlg.ShowOpen C Cdlg.ShowSaveAs B Cdlg.ShowSave D ShowOpen Cdlg ShowOpen ShowSave ShowFont Action ShowOpenA A 5Cdlg A Cdlg.Action=6 C Cdlg.Action=4 B Cdlg.Action=5 D Cdlg.Action=3 Action 6 A 6 A FileName B Filter C FilterIndex D Name 4 FileName Filter FilterIndex Name A 7 A FontSize B FontName C Max D Min 4 FontSize FontName MaxPoint Min Point

170 160 2 C C 8 A Copage B FromPage C Pages D Topage 4 Copage FromPage Topage A Pages A 9 FileName A B C D FileName D D 10 CommonDialog1Command1 Save SaveFile*.txt A Private Sub Command1_C1ick() CommonDialog1.FileName="SaveFile" CommonDialog1.Filter= "All Files *.* (*.txt) *.txt (*.doc. *.doc" CommonDialog1.FilterIndex=2 CommonDialog1.Dialog.Title="Save" CommonDialog1.Action=2 B Private Sub Command1_Click() CommonDialog1.FileName="SaveFile" CommonDialog1.Filter="A11 Files *.* (*.txt) *.txt *.doc *.doc" CommonDialog1.FilterIndex=1 CommonDialog1.DialogTitle="Save"

171 CommonDialog1.Action=2 C Private Sub Command1_C1ick() CommonDialog1.FileName="Save" CommonDialog1.Filter="All Files *.* (*.txt) *.txt (*.doc *.doc" CommonDialog1.FilterIndex=2 CommonDialog1.DialogTitle="SaveFile" CommonDialog1.Action=2 D Private Sub Command1_C1ick() CommonDialog1.FileName="SaveFile" CommonDialog1.Filter="All Files *.* (*.txt) *.txt (*.doc *.doc" CommonDialog1.FilterIndex=1 CommonDialog1.DialogTitle= Save CommonDialog1.Action=1 Action2 DDialogTitle C *.txtfilter FilterIndex B A FileName FileTitle FileName FileTitle 2Form1CommonDialog1 Action 2 CommonDialog1.showSave 3Form1 Form2 Form2 Form1.show vbmodeless,form2

172 Load Load 2 Unload Unload 2 [].Show [] 1 0 []. Hide Visual Basic Show 2

173 exe Visual Basic Visual Basic Visual Basic3 1 Public Dim Private 2 Dim Public 3 SubMain SubMain Form_LoadSubMain SubMain SubMain SubMain SubMainVisual Basic DoEvents DoEventsVisual BasicDoEvents

174 164 2 DoEvents [ =]DoEvents[()] DoEvents DoEvents DoEvents CPU DoEvents A Sub Main BShow CHide Unload D Sub Main Hide Unload C 2 A BPrivate CVisual Basic D B 3Visual Basic A B

175 CForm1 D Visual Basic 1 B 4MDI A B CMDI DMDI MDIMDI MDI D 5 Form1Form2X Form1 A Dim X As Integer C Private X As Integer B Static X As Integer D Public X As Integer Dim Private Static Public D 6 MDI A MDI BMDI C MDI DMDI MDI MDI MDIMDIMDI MDI MDI B

176 166 2 B 7 Form1 A Form1.Unload B Close Form1 C Form1.End D Unload Form1 Unload EndA C Visual Basic Close BUnload D D 8 MDI A MDI B MDI C D MDIMDI MDI MDI MDI MDI MDI MDIMDI D D 9 MDI A MDIForm1.Arrange0 C MDIForm1.Arrange2 B MDIForm1.Arrange1 D MDIForm1.Arrange3 MDIArrangeArrange 0 MDI 1 MDI 2MDI 3 MDI C C 10 4 DoEvents

177 A DoEvents B DoEvents C DoEvents D DoEvents DoEvents C C 11 A B C D D D Form1 Initialize Load Activate Resize Paint Paint 2myfrm1 Command1_Click Visual BasicShow Show Visual BasicModel 1Visual BasicModel 0 myfrm1.show vbmodel myfrm1.show 1 3 DoEvents Visual Basic DoEvents 4 Me

178 168 2 Me MeUnload Form1 Unload 5

179 ASCII ASCII ASCII Open [For ] [Access ] [] As[#] [Len=]

180 Input Output Append Output Random/ Binary Output Append Input Random Binary 2 Close # Open 3 1 Seek Seek # Input Output Append Random Get Put Seek 0 SeekSeek

181 Seek Seek( ) Input Output AppendSeek RandomSeek SeekSeek 4 1 FreeFile 2 Loc Loc( ) 3 LOF LOF( ) Visual Basic EOF EOF( ) True False GetTrue

182 172 2 Do While EOF(1) Loop Print# Write# 1 Print# Print#,[[Spc(n) ab(n)][][;,] Print# Print# Print# 2 Write# Write#,[] Write# Output Append Print# Write# 2 Input # Line Input # 1 Input # Input#,

183 Line Input# Line Input#, 3 Input$ Input (,# ) / 1 1 Put #[ ] Get Put Seek Open Len Put 2 Get #[ ]

184 Drive Click Change 2 Path Click Change 2 Pattern Click DblClick Kill Kill *? 2FileCopy

185 FileCopy, FileCopy * 3 Name Name As Name * A B C Open D Input # 4 Open Input # Get # B B 2 Path A

186 176 2 B C D A 3 True A Archive B Normal C Hidden D System ArchiveTrue HiddenTrue SystemTrue NormalTrue C 4 OpenFor A Output B Input C Append D Random Visual BasicFor Random D 5 A B C D Input # Print # Get # Put #Input # Print # D D 6 Open "c:test.dat" For OutPut As #1 AC Test.Dat

187 B C Test.Dat C1 D Print # Test.Dat OutputOpen A 7Text1 Text2 Command1 Type Person name As String*8 major As String*20 End Type Test29.dat Person p A Open "c:\test29.dat" For Random As#1 Put #1,1,p Close #1 B Open "c:\test29.dat" For Random As #1 Get #1,1,p Close #1 C Open "c\test29.dat" For Random As #1 Len=Len(p) Put #1,1,p Close #1 D Open "c:\test29.dat" For Random As #1=Len(p) Get #1,1,p Close #1 plen A BPut Get Get C C

188 ListIndex A2 B1 C 0 D 1 ListIndex 0ListIndex 1 B 9 Loc A B C /128 D LocOpen / 128 A A 10 A Drive B Path C Name D Pattern 4 Path Name Drive Pattern B B 11 Path A B C D Path A 12 Drive1 Dir1

189 File1Label1 Label2 Label1 A Private Sub Dir1_Change() File1. Path=Dir1.path Private Sub Drive1_Change() Dir1.Path=Drive1.Drive Label1.Caption=File1.ListCount B Private Sub Dir1_Change() File1.Path=Dir1.Path Private Sub Drive1_Change() Dir1.Path=Drive1.Drive Label1.Caption=File1.List C Private Sub Dir1_Change() File1.Path=Dir1.Path Label1.Caption=File1.ListCount Private Sub Drive1_Change() Dir1.Path=Drive1.Drive Label1.Caption=File1.ListCount D Private Sub Dir1_Change() File1.Path=Dir1.Path Label1.Caption=File1.List Private Sub Drive1_Change() Dir1.Path=Drive1.Drive Label1.Caption=File1.List

190 180 2 Drive1 Dir1File1 Drive1_Change Dir1.Path=Drive1.Drive Dir1_Change File1.Path=Dir1.Path C C 13 Type Books Name As String *10 TelNum As String *20 End Type Command1 Command1_Click Person. txt A Private Sub Command1_Click() Dim B As Books Open "c:\person.txt" For Output As #1 B.Name=InputBox("") B.TelNum=InputBox("") Write #1,B.Name,B.TelNum Close #1 B Private Sub Command1_Click() Dim B As Books Open "c:\person.txt" For Input As #1 B.Name=InputBox("") B.TelNum=InputBox("") Print #1,B.Name,B.TelNum Close #1 C Private Sub Command1_Click() Dim B As Books Open "c:\person.txt" For Output As #1 B.Name=InputBox("") B.TelNum=InputBox("") Write #1,B Close # 1 D Private Sub Command1_Click() Open "c:\person.txt" For Input As #1 Name=InputBox("") TelNum=InputBox("") Print #1,Name,TelNum Close #1

191 B D Input C Write #A A 14Open "Text.Dat" For Output As # FreeFile A Text.Dat BText.Dat CText.Dat DText.Dat OutputText.Dat Text.Dat C C 15 Work.Dat A Open "Work.Dat" For OutPut As #1 B Open "Work.Dat" For Append As #1 C Open Work.Dat For OutPut As #1 D Open Work.Dat For Append As #1 Open Append B B Visual Basic 3 2C a1.txt FileLen FileLen LOF FileLen("C:\a1.txt")

192 Drive1Dir1 Drive1_Change Change Path Drive1_Change Dir1.Path=Drive1.Drive Dir1.Path=Drive1.Drive Dmyfile1.dat Private Sub Form_Click() Dim k As Integer Open Randomize For I=1 To 10 K=100+Int (899*RnD) "d:\myfile1.dat" For Random as # 1 For 10 Put Put # 1, I, k Close # 1 Next I "d:\myfile1.dat" For Random As # 1 Put # 1, I, k Close # 1 5Ca1.txt Da2.txt Private Sub Form_Click() Dim Ch As String Open "c:\a1.txt" For As # 10 Open"d:\a2.txt" For Output As # 20 Do While LineInput # 10,Ch Loop Close # 10 Close # 20

193 Input Do While Not EOF 10 20,Ch Print # Input Not EOF 10 Print # 20,Ch 610D a1.dat 5 Private S Dim k As Dim n As Int N=Len(k) ub Form_Click() Integer eger,i As Integer Open As #10 Len=n For I=1 To 10 K=InputBox(" ") Next I Get # 10,k Print k "D:\a1.dat" For Random For 10Put #10,I,k 5Seek #5 Seek #10, 5 Get# "D:\a1.dat" For Random Put # 10,I,k Seek # 10, 5 7al.txt Private Sub Form_Click() Dim Ch As String *1 Dim n As Integer Open "c:\al.txt"for Input As #10 Do While Ch=Input(1,#10) If Then n=n+1 End If Loop Close #10

194 184 2 nal.txt n 1 Not EOF(10) Ch>="0" And Ch< ="9" n Print n Not EOF 10 Ch>="0" And Ch<="9" Print n Option Base1 Private Sub Form_ Click() Dim a 10 As Integer,I As Integer Dim sum As Integer, aver As Single For I=1 To 10 a(i)=int(100 *Rnd )+1 sum=sum+ a(i) Next I Print sum,aver 10a For sumfor Randomize Randomize aver=aver/10 Randomize aver=aver/10 9 File1Dir1 Dir1_Change Change Path Change Path PathFile1.Path=Dir1.Path File1.Path=Dir1.Path

195 3 >>>>

196 Pentium 300MHz 64MB MB (VGA) 2 Windows 2000 Visual Basic

197

198 N Y

199

200 Visual Basic 6.0Visual Basic 6.0 Visual Basic 6.0 Visual Basic Visual Basic 6.0 Visual Basic Visual Basic

201 Visual Basic 2 2? 3 1

202 Visual Basic 3 4

203 19 1 Form1 Labe11 Text1 Text Command1 Click sjt1.vbp sjt1.frm Visible False Print ClickCancel TrueEsc Click Default True Click Click Private Sub Command1_Click() Label1.Visible = False Text1.Visible = False Form1.Print Text1.Text

204 Form1Text1 Text FontNameHScroll1 Min 10 Max 100 LargeChange 5 SmallChange 2 sjt2.vbp sjt2.frm ValueFontSizeValue ChangeChange Change Private Sub HScroll1_Change() Text1.FontSize = HScroll1.Value 3 Form1 Command1 3 Index sjt1.vbp sjt1.frm

205 Height Left Ctrl+C Ctrl+V 3Command1 Caption 4 Form1Text1 0 C1T1 1 Text1.Text=Text1.Text+1 T1.Enabled=True sjt2.vbp sjt2.frm T1EnabledFalse C1 ClickT1 EnabledTrue 1T1 Interval1 000T11 TimerIntervalC1 Click T1.Interval = 1000 Timer Text1.Text = Text1.Text Text Name Command1Caption T1 Enabled False Click Private Sub Command1_Click() T1.Enabled = True Timer Private Sub T1_Timer() Text1.Text = Text1.Text+1

206 Form1 Timer1 1 Timer 2 sjt1.vbp sjt1.frm Timer IntervalTimer Interval= Timer Interval= Timer Interval=0Timer Interval Timer1 Interval Form1Text1 P1 sjt2.vbp,sjt2.frm Text1 KeyPress KeyUp KeyDown

207 Private Sub Text1_KeyPress(KeyAscii As Integer) Picture1.Print Text1.Text+Chr(KeyAscii) Private Sub Text1_KeyUp(KeyCode As Integer,Shift As Integer) Picture.Print Text1.Text 7 Form1 Label1 Label2 Text1 Text2 Text Command1 Click sjt1.vbp sjt1.frm InputBox 1 23 InputBox Text Private Sub Command1_Click() Dim a As String, b As String Text1.Text = InputBox(" ","") Text2.Text = InputBox(" "," ") 8 Form1Text1 HScroll1 Min 500 Max 2000

208 198 3 LargeChange 50 SmallChange sjt2.vbp sjt2.frm Value ChangeValue Change Value Height WidthHeight Text1 HScroll1 Private Sub HScroll1_Change() Text1.Height = HScroll1.Value Text1.Width = Text1.Height * Form12 file edit 3cut copy paste

209 sjt1.vbp sjt1.frm 2003/9 Visual Basic Text1 Text2 Text1 * Text2 sjt2.vbp sjt2.frm 2003/9 TextText1 * Text1 PasswordChar* Text2 Text1 Change Text2.Text = Text1.Text Private Sub Text1_Change() Text2.Text = Text1.Text 11 Form1T1 T2 T1 T2

210 200 3 sjt1.vbp sjt1.frm 2003/9 10 Text T1 Text2 Text1 Change Text2.Text = Text1.Text Private Sub Text1_Change() Text2.Text = Text1.Text 12 Form1Text1 C1 sjt2.vbp sjt2.frm 2003/9 Width Private Sub C1_Click() Text1.Move (Form1.Width Text1.Width) 13 Form1Text1 Op Dis Exit

211 sjt1.vbp sjt1.frm 2003/9 Private Sub dis_click() Text1. Text = "" Private Sub exit_click() End 14 Form1L1 4 AAAA BBBB CCCC DDDD sjt2.vbp sjt2.frm 2003/9 ListIndex ListIndex Private Sub L1_Click() L1.RemoveItem (ListIndex) 15 Form1 T C1 C2 C1 C2 3

212 202 3 sjt1.vbp sjt1.frm2003/9 3 Text1.Height = 2 * Text1.Height Text1.Width = 2 * Text1.Width Text1.FontSize = 3 * Text1.FontSize Private Sub C1_Click() Text1.Text = "" Private Sub C2_Click() Text1.Height = 2 * Text1.Height Text1.Width = 2 * Text1.Width Text1.FontSize = 3 * Text1.FontSize 16 Form1C1 Text1 Text2 Text1 Text1 Text2Text1 visual basic programming sjt2.vbp sjt2.frm2003/9 LCase UCase LCase$ UCase$

213 Private Sub C1_Click() Text1.Text = LCase$(Text1.Text) Text2.Text = UCase$(Text1.Text) 17 Form1Command1 Command2 Command Command sjt1.vbp sjt1.frm2003/ Private Sub Command1_Click() Form1.Height = 1.2 * Form1.Height Form1.Width = 1.2 * Form1.Width Private Sub Command2_Click() Form1.Left = Form1.Left Form1.Top = Form1.Top Form1Label1 Left 0 HScroll1 Min 0 Max 3000 SmallChange 10 LargeChange 100

214 204 3 sjt2.vbp sjt2.frm2003/9 Left Value HScroll1_Change Left Private Sub HScroll1_Change() Label1.Left = HScroll1.Value 19 Form1 1 2 File Open Close sjt1.vbp sjt1.frm 2003/9 20 Form1Text1 Text2 Text1 Text2 Text1Text2 Text1

215 sjt2.vbp sjt2.frm2003/9 Text1 Text2 Text1 Change Text2.Text = Text1.Text Font Private Sub Text1_Change() Text2.Text = Text1.Text 21 Form1Command1 CD1 sjt1.vbp sjt1.frm2003/9 ActiveX

216 206 3 Filter Action CD1.Action = 1 Action CD1.ShowOpenShowOpen Private Sub Command1_Click() CD1.ShowOpen Filter FilterIndex Private Sub Command1_Click() CD1.Action = 1 22 Form1 Command1 100 sjt2.vbp sjt2.frm2003/9 Click Command1. Left = Command1.Left 100 Private Sub Command1_Click() Command1.Left = Command1.Left Form1H1

217 L1 L sjt1.vbp sjt1.frm 2003/9 Max 100 Min 1 LargeChangeValue Form1Text1 Text2 M1 Copy Clear Text1 Text2 Text2 Text2 sjt2.vbp sjt2.frm 2003/9 Click

218 208 3 Private Sub Copy_Click() Text2.Text = Text1.Text Private Sub Clear_Click() Text2.Text = "" 25 Form1 Label1 Label2 Text1 Text2 Text Command1 Click sjt1.vbp sjt1.frm 2004/4 Command1 Click() Private Sub Command1_Click() Print Text1.Text & "," & "" & Text2.Text & " " 26 Form1Picture1 Hscrol1Command1 pic1.jpg Min 100 Max 1500 LargeChange 100 SmallChange 10

219 sjt2.vbp sjt2.frm 2004/4 Command1 Click() HScroll1 Change() Width Value Private Sub Command1_Click() HScroll1.Max = 1500 HScroll1.Min = 100 HScroll1.LargeChange = 100 HScroll1.SmallChange = 10 Private Sub HScroll1_Change() Picture1.Width = HScroll1.Value 27 Form1 Label1 Text1 Text Command1 Click sjt1.vbp sjt1.frm 2004/4 VisibleFalse

220 210 3 Private Sub Command1_Click() Text1.Visible = False Label1.Visible = False Print Text1.Text

221 20 1 sjt3.vbp Item Add Delete List1 Text1 sjt3.vbpsjt3.frm Private Sub Add_ Click() Text1.Text = InputBox( " ") List1.AddItem? Private Sub Delete_Click() Text1.Text = InputBox(" ") For i = 0 To? If List1.List(i) =? Then List1.RemoveItem?

222 212 3 End If Next i 1 Text1.Text 2For ListCount i 0List1.ListCount 1 34 IfFor Text1.Text i Private Sub Add_Click() Text1.Text = InputBox(" ") List1.AddItem Text1.Text Private Sub Delete_Click() Text1.Text = InputBox(" ") For i = 0 To List1.ListCount 1 If List1.List(i) = Text1.Text Then List1.RemoveItem i End If Next i 2 sjt4.vbpsjt4.frm FindMax4 Option Base 1 Private Function FindMax(a() As Integer) Dim Start As Integer

223 Dim Finish As Integer, i As Integer Start =?(a) Finish =?(a) Max =?(Start) For i = Start To Finish If a(i)? Max Then Max =? Next i FindMax = Max End Function Private Sub Command1_Click() Dim arr1 Dim arr2(4) As Integer arr1 =Array( Val(Text1.Text),Val(Text2.Text),Val(Text3.Text),Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(?) Next i M = FindMax(?) Print": ";M 12For Lbound Ubound 3Max a(start) Max 45IfForMax a(i)>max a(i)max 64 Cint arr1(i) 7FindMax() arr2() Option Base 1 Private Function FindMax(a() As Integer) Dim Start As Integer Dim Finish As Integer, i As Integer Start = Lbound(a) Finish = Ubound(a) Max = a(start) For i = Start To Finis h If a(i) Max Then Max = a(i) Next i FindMax = Max End Function Private Sub Command1_Click() Dim arr1 Dim arr2(4) As Integer arr1 = Array(Val(

224 214 3 Text1.Text),Val(Text2.Text),Val(Text3.Text),Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i M=FindMax(arr2()) Print ": ";M Form2 Form2 Form1 Form2 Form2 Form1Form1Form1 Form2 3 sjt3.vbp Form1 Form2Form1 Form2 C1 C2 Form1 Private Sub C1_Click() End Private Sub C2_Click() Load?? = True Form1 Form2 Form1 C2 ClickLoad Form1Visible True Form2

225 Private Sub C1_Click() End Private Sub C2_Click() Load Form1 Form1.Visible=True 4 sjt4.vbp P1 3 Private Sub C1_Click() Dim k As Integer For k = 0 To 2 If Op1(k).? Then Call draw(?) End If Next k Sub draw(a As Integer) P1.Print" "& Op1(?).Caption 0 Op1Op1(1) Op1(2)3 Op1(i).Caption ValueTrue

226 216 3 C1_ClickFor drawcaption Private Sub C1_Click() Dim k As Integer For k = 0 To 2 If Op1(k).Value Then Call draw(k) End If Next k Sub draw(a As Integer) P1.Print " " & Op1(a).Caption 5 sjt3.vbp 3 Private Sub C1_Click() For i =? To? If Op1(i).? = True Then Print"" + Op1(i).? End If Next i 4 Private Sub C1_Click() For i = 0 To 2

227 If Op1(i). Value = True Then Print""+Op1(i). Caption End If Next i 6 sjt4.vbp Form13 B1 B2 L1L B1 B2 Cb1 Cb2 Cb Cb2 Cb1Cb2L1 Private Sub Form_Unload(Cancel As Integer) Open"out4.txt" For Output As #1 Print #1, Cb1.Text, Cb2.Text, CInt(L1.Font.Size), L1.Font Close #1 L1 Click Cb1 Val L1 FontSize Cb2Windows Private Sub Cb1_Click() L1.FontSize = Val(Cb1.Text) Private Sub Cb2_Click() L1.FontName = Cb2.Text Private Sub Form_Unload(Cancel As Integer)

228 218 3 Open"out4.txt"For Output As #1 Print #1,Cb1.Text,Cb2.Text,CInt(L1.Font.Size),L1.Font Close #1 7 sjt3.vbp Option1 Option2 List1 Text1Click 3 sjt3.vbpsjt3.frm Private Sub Form_Click() If Option1.Value = True Then Text1.Text = InputBox(" ") List1.AddItem? End If If Option2.Value = True Then Text1.Text = InputBox(" ") For i = 0 To? If List1.List(i) =? Then List1.RemoveItem? End If Next i End If 1Value True Option1 Text1.Text 2Option2 ListCount

229 List0 For 0 ListCount 1 List1.ListCount 1 3RemoveItem i Private Sub Form_Click() If Option1.Value = True Then Text1.Text = InputBox(" ") List1.AddItem Text1.Text End If If Option2.Value = True Then Text1.Text = InputBox(" ") For i = 0 To List1.ListCount 1 If List1.List(i)=Text1.Text Then List1.RemoveItem i End If Next i End If 8 sjt4.vbpsjt4.frm Sort 4 Option Base 1 Private Sub Sort(a() As Integer) Dim Start As Integer, Finish As Integer Dim i As Integer, j As Integer, t As Integer Start =?(a) Finish =?(a) For i =? To 2 Step 1 For j = 1 To? If a(j)? a(j + 1) Then t = a(j + 1) a(j + 1) = a(j) a(j) = t End If

230 220 3 Next j Next i Private Sub Command1_Click() Dim arr1 Dim arr2(4) As Integer arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i Sort arr2() Text1.Text = arr2(1) Text2.Text = arr2(2) Text3.Text = arr2(3) Text4.Text = arr2(4) 12Sort a Lbound UboundLbound Ubound 345 For n n 1 1 ifinish 2 1 j1 i 1 Option Base 1 Private Sub Sort(a() As Integer) Dim Start As Integer, Finish As Integer Dim i As Integer, j As Integer, t As Integer Start = Lbound(a) Finish = Ubound(a) For i = Finish To 2 Step 1 For j = 1 To i-1 If a(j) a(j + 1) Then t=a(j + 1) a(j + 1) = a(j) a(j) = t End If Next j Next i Private Sub Command1_Click()

231 Dim arr1 Dim arr2(4) As Integer arr1 = Array(Val( Text1.Text),Val(Text2.Text),Val(Text3.Text),Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i Sort arr2() Text1.Text = arr2(1) Text2.Text = arr2(2) Text3.Text = arr2(3) Text4.Text = arr2(4) 9 Form1P1 P pic1.bmpP1 pic2.jpgp2 C1 P1 pic2.jpgp2 pic1.bmp 3 sjt3.vbp sjt3.frm 2003/9 3 Picture Picture Private Sub Command1_Click() Form1.Picture = P1.Picture P1.Picture = P2.Picture P2.Picture = Form1.Picture Form1.Picture = LoadPicture("")

232 sjt4.vbp Ch1 Ch2 Text1 C1 sjt4.vbp sjt4.frm 2003/9 Value 0 1 CaptionText1 Text Load Text Dim a As String Private Sub C1_Click() If Ch1.Value = 0 And Ch2.Value = 0 Then Text1.Text = a End If If Ch1.Value = 1 And Ch2.Value = 0 Then Text1.Text = a & Ch1.Caption End If If Ch1.Value = 0 And Ch2.Value = 1 Then Text1.Text = a & Ch2.Caption End If If Ch1.Value = 1 And Ch2.Value = 1 Then

233 Text1.Text = a & Ch1.Caption & Ch2.Caption End If Private Sub Form_Load() a = Text1.Text 11 sjt3.vbp Text1 L1 C1 2003/9 Private Sub C1_Click() ' L1.? Text1.Text Private Sub L1_Click() ' L1.RemoveItem? AddItem RemoveItem Text1.Text AddItem ListIndex RemoveItem Private Sub C1_Click() L1. AddItem Text1.Text Private Sub L1_Click() L1.RemoveItem L1.ListIndex 12 sjt4.vbp Text1C1 3 Op1 Op2 Op3

234 / Value True False Private Sub C1_Click() If Op1.Value = True Then Text1.Text = "1" If Op2.Value = True Then Text1.Text = "10" If Op3.Value = True Then Text1.Text = "15" 13 sjt3.vbp F1 F2 F1 Op1 Op2 F2 Op3 Op4C1 Text sjt3.vbp sjt3.frm2003/9

235 /9 Value True False Private Sub Command1_Click() If Op1.Value = True And Op3.Value = True Then Text1.Text = "" End If If Op1.Value = True And Op4.Value = True Then Text1.Text = "" End If If Op2.Value = True And Op3.Value = True Then Text1.Text = "" End If If Op2.Value = True And Op4.Value = True Then Text1.Text = "" End If 14 sjt4.vbp 3 Text1 Text2 Text3 Op1 Op2 Text1 Text2 Text1 Text2Text1Text2 Text3 sjt4.vbp sjt4.frm

236 /9 Text3 Private Sub Op1_Click() Dim a As String a = Text1.Text Text1.Text = Text2.Text Text2.Text = a Op1.Visible = False Private Sub Op2_Click() Text3.Text = Text1.Text & Text2.Text 15 sjt3.vbp sjt3.frm 4Visual Basic Turbo C C++ Java Option1 XXX Option2 XXX XXX 2003/9 List

237 ListIndex Value True Private Sub C1_Click() If Option1.Value = True Then Text1.Text = List1.List(List1.ListIndex) & "" Else If Option2.Value = True Then Text1.Text = List1.List(List1.ListIndex) & "" End If End If 16 sjt4.vbp sjt4.frm Command /9 Private Sub Command1_Click() Dim i As Integer, j As Integer, isum As Integer Print "1250" For i = 1 To 500 '? = 0 For j = i To 500 ' isum =? If isum >= 1250 Then Exit For Next j ' If isum =? Then Print i; " "; j End If Next i For

238 iSum isum 2 isum + i Private Sub Command1_Click() Dim i As Integer, j As Integer, isum As Integer Print "1250" For i = 1 To 500 isum = 0 For j = i To 500 isum = isum + j If isum >= 1250 Then Exit For Next j If isum = 1250 Then Print i; " "; j End If Next i 17 Form1 Timer1 Image1 pic.ico HScroll1 Min100 Max1200 LargeChange100 SmallChange25 sjt3.vbp sjt3.frm 2003/9 HScroll1 Change Timer1 IntervalHScroll1 Value Image1 Visible Visible Timer1 Timer Private Sub HScroll1_Change() Timer1.Interval = HScroll1.Value Private Sub Timer1_Timer()

239 Image1.Visible = Not Image1.Visible 18 sjt4.vbp List1 3 _GB2312Text1 HScroll /9 Private Sub HScroll1_Change() ' Text1.FontSize =? If List1.Text <> "" Then ' Text1.FontName =? Else MsgBox " ",, "" End If Value FontSize TextFontName

240 230 3 Private Sub HScroll1_Change() Text1.FontSize = HScroll1.Value If List1.Text <> "" Then Text1.FontName = List1.Text Else MsgBox " ",, "" End If 19 sjt3.vbp 2003/9 Private Sub Form_Unload(Cancel As Integer) unload_sub Sub unload_sub() Open "out3.dat" For Output As #1 Print #1,Form1.Op1.Value,Form1.Op2.Value,Form1.Ch1.Value, Form1.Ch2.Value, Form1. Text1.FontName, Form1.Text1.FontUnderline,Form1.Text1.FontItalic Close #1 Op1(0).Value = True FontName FontUnderline

241 FontItalic Private Sub Command1_Click() If Op1(0).Value = True Then Text1.FontName = "" Else Text1.FontName = "" End If If Check1.Value = 1 Then Text1.FontUnderline = True Else Text1.FontUnderline = False End If If Check2.Value = 1 Then Text1.FontItalic = True Else Text1.FontItalic = False End If 20 sjt4.vbp /9 Private Sub Timer1_Timer() ' P1.? P1.Left + 20 Timer1 Interval Timer Timer1 TimerLeft

242 232 3 = Click Timer1 Enabled Timer1 Interval 100 Private Sub Timer1_Timer() P1. Left = P1.Left + 20 Private Sub C1_Click() Timer1.Enabled = True Private Sub C2_Click() Timer1.Enabled = False 21 Form1Label1 Text1Combo1 3 Command1 Command2Text1 Text1 Click sjt3.vbp sjt3.frm2003/9 Command1 Click()Text1 Combo1 Command2 Click()Combo1 ListCount Private Sub Command1_Click() Combo1.AddItem Text1.Text Private Sub Command2_Click()

243 Print Combo1.ListCount 22 sjt4.vbp n nz a ZA 2003/9 Private Sub Command1_Click() Dim n As Integer, k As Integer, m As Integer Dim c As String, a As String For k = 0 To 2 If Op1(k).Value Then ' n = Val(Op1(k).? ) End If Next k m = Len(Text1.Text) a = "" ' For k = 1 To? ' c = Mid$(Text1.Text,?, 1) c = String(1, Asc(C + n) If c > "z" Or c > "Z" And c < "a" Then c = String(1, Asc(C 26) End If '? = a + c Next k Text2.Text = a Asc Ascii Len Mid

244 234 3 String Val 1 CaptionCaption 2For m 3 k 4 aa Private Sub Command1_Click() Dim n As Integer, k As Integer, m As Integer Dim c As String, a As String For k = 0 To 2 If Op1(k).Value Then n = Val(Op1(k). Caption ) End If Next k m = Len(Text1.Text) a = "" For k = 1 To m c = Mid$(Text1.Text, k, 1) c = String(1, Asc(C + n) If c > "z" Or c > "Z" And c < "a" Then c = String(1, Asc(C 26) End If a = a + c Next k Text2.Text = a 23 sjt3.vbp L1 Op13 Index Text1 Op1 Click Text1 Text1

245 /9 Private Sub Op1_Click(Index As Integer) Dim a As String, b As String, c As String a = "" b = "" ' Select Case? Case 0 Text1.Text = a + Me.Op1(0).Caption + " " Case 1 ' Text1.Text =? + Me.Op1(1).Caption + " " Case 2 Text1.Text = b + Me.Op1(2).Caption + " " End Select SelectIndex 1Index2 a Private Sub Op1_Click(Index As Integer) Dim a As String, b As String, c As String a = "" b = "" Select Case Index Case 0 Text1.Text = a + Me.Op1(0).Caption + " " Case 1 Text1.Text = a + Me.Op1(1).Caption + " " Case 2 Text1.Text = b + Me.Op1(2).Caption + " " End Select 24 sjt4.vbp Form1 Text1 F1 F2

246 236 3 F1Op1 Op2 F2 Op3 Op4C1 F1 F2 Text1 2003/9 Private Sub Form_Unload(Cancel As Integer) Open "out4.txt" For Output As #1 Print #1, Op1.Value, Op2.Value, Op3.Value, Op4.Value, Text1.Text Close #1 Value True False Private Sub Command1_Click() If Op1.Value = True And Op3.Value = True Then Text1.Text = " " End If If Op1.Value = True And Op4.Value = True Then Text1.Text = " " End If If Op2.Value = True And Op3.Value = True Then Text1.Text = " "

247 End If If Op2.Value = True And Op4.Value = True Then Text1.Text = " " End If 25 sjt3.vbpsjt3.frm List1 Text1 MouseDown /4 Private Sub Form_MouseDown(Button As Integer, _ Shift As Integer, X As Single, Y As Single) If Button = 1 Then Text1.Text = InputBox(" ") ' List1.AddItem? End If If Button = 2 Then Text1.Text = InputBox(" ") ' For i = 0 To? ' If List1.List(i) =? Then ' List1.RemoveItem? End If Next i End If 1 Text1.Text 2

248 238 3 ForList1.ListCount 1 3List Text1.Text 4i Private Sub Form_MouseDown(Button As Integer, _ Shift As Integer, X As Single, Y As Single) If Button = 1 Then Text1.Text = InputBox(" ") List1.AddItem Text1.Text End If If Button = 2 Then Text1.Text = InputBox(" ") For i = 0 To List1. ListCount 1 If List1.List(i) = Text1.Text Then List1.RemoveItem i End If Next i End If 26 sjt4.vbpsjt4.frm FindMin4 2004/4 Option Base 1 Private Function FindMin(a() As Integer) Dim Start As Integer Dim Finish As Integer, i As Integer ' Start =?(a) ' Finish =?(a) ' Min =?(Start) For i = Start To Finish

249 ' If a(i)? Min Then Min =? Next i FindMin = Min End Function Private Sub Command1_Click() Dim arr1 Dim arr2(4) As Integer arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i ' M = FindMin(?) Print ": "; M LBound Ubound CInt 12For Lbound Ubound 3Min a 45Mina(i) < Min a(i) Min< a(i) 6 FindMin arr2 arr2 Option Base 1 Private Function FindMin(a() As Integer) Dim Start As Integer Dim Finish As Integer, i As Integer Start = LBound(A Finish = UBound(A Min = a (Start) For i = Start To Finish If a(i) < Min Then Min = a(i) Next i FindMin = Min End Function Private Sub Command1_Click() Dim arr1

250 240 3 Dim arr2(4) As Integer arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i M = FindMin( arr2 ) Print ": "; M 27 sjt3.vbp Item Add Delete List1 Text1 sjt3.vbpsjt3.frm 2004/4 Private Sub Add_Click() Text1.Text = InputBox(" ") ' List1.AddItem? Private Sub Delete_Click() Text1.Text = InputBox(" ") ' For i = 0 To? ' If List1.List(i) =? Then ' List1.RemoveItem? End If Next i 7

251 Private Sub Add_Click() Text1.Text = InputBox(" ") List1.AddItem Text1.Text Private Sub Delete_Click() Text1.Text = InputBox(" ") For i = 0 To List1.ListCount 1 If List1.List(i) = Text1.Text Then List1.RemoveItem i End If Next i 28 sjt4.vbpsjt3.frm Sort4 sjt4.vbp sjt4.frm2004/4 Option Base 1 Private Sub Sort(a() As Integer) Dim Start As Integer, Finish As Integer Dim i As Integer, j As Integer, t As Integer ' Start =?(a) ' Finish =?(a) ' For i =? To 2 Step 1 ' For j = 1 To? ' If a(j)? a(j + 1) Then t = a(j + 1) a(j + 1) = a(j) a(j) = t End If Next j

252 242 3 Next i Private Sub Command1_Click() Dim arr1 Dim arr2(4) As Integer arr1 = Array(Val(Text1.Text), Val(Text2.Text), Val(Text3.Text), Val(Text4.Text)) For i = 1 To 4 arr2(i) = CInt(arr1(i)) Next i Sort arr2() Text1.Text = arr2(1) Text2.Text = arr2(2) Text3.Text = arr2(3) Text4.Text = arr2(4) 8 8

253 21 1 sjt5.vbptext1 0 Op1 13 C1 C2 13 Text1 1Text1 Private Sub Op1_Click(Index As Integer) Select Case? Case 0 Timer1.Interval = 1000 Case 1 Timer1.Interval = 3000 End Select Private Sub Timer1Timer() Text1.Text =?.Text Index ClickIndexSelect IndexIndex 2 Timer 1

254 244 3 C1 C2 Click C1Timer1 Enabled True C2Timer1 Enabled False Timer1 EnabledFalse Private Sub Op1_Click(Index As Integer) Select Case Index Case 0 Timer1.Interval = 1000 Case 1 Timer1.Interval = 3000 End Select Private Sub Timer1_Timer() Text1.Text=Text1.Text+1 C1 C2 Click Private Sub C1_Click() Timer1.Enabled = True Private Sub C2_Click() Timer1.Enabled = False 2 sjt5.vbp P1 P2 P1.ico.ico.icoTimer1 Timer2 Timer1 123Timer2 Dim a%, b As Boolean Private Sub C1_Click()

255 Timer2.Enabled=? b=true Private Sub Timer1_Timer() a=a+1 If a 6 Then a=1 End If Select Case a Case 1 P1.Picture = LoadPicture(".ico") Case 2, 3 P1.Picture = LoadPicture(".ico") Case 4, 5, 6 P1.Picture = LoadPicture("?") If b Then Timer2.Enabled = True End Select Private Sub Timer2_Timer() If (a <4) And (P2.Left > P1.Left And P2.Left < P1.Left + P1.Width) Or P2.Left <= 100 Then Timer2.Enabled=? Else P2.Move? 10, P2.Top, P2.Width, P2.Height End If Timer2 Enabled FalseTimer2 Timer C1 C1 Click Timer2.Enabled=True Timer13Timer1 Interval a Timera1 6a=1 1 a=2 3 2 a= Select Case a a=4 5 6P1.Left + P1.Width P1.Left P1.Left+P1.Width P1.Left b Dim a%, b As Boolean Private Sub C1_Click()

256 246 3 Timer2.Enabled = True b=true Private Sub Timer1_Timer() a=a+1 If a>6 Then a=1 End If Select Case a Case 1 P1.Picture = LoadPicture(".ico") Case 2,3 P1.Picture = LoadPicture(".ico") Case 4,5,6 P1.Picture = LoadPicture(".ico") If b Then Timer2.Enabled = True End Select Private Sub Timer2_Timer() If (a<4) And (P2.Left>P1.Left And P2.Left<P1.Left + P1.Width) Or P2. Left<= 100 Then Timer2.Enabled = False Else P2.Move P2.Left 10, P2.Top, P2.Width, P2.Height End If 3 sjt5.vbp Text1 C1 C2 isprime a True False Text1 Text1 out5.txt isprime out5.txt isprime Private Function isprime(a As Integer) As Boolean Dim flag As Boolean flag = True

257 b% = 2 Do While b% <= Int(a/2) And flag If Int(a/b%) = a/b% Then flag = False Else b% = b%+1 End If Loop isprime = flag End Function i= ii 1 Do While Loop Exit Do OutputPrint# Text1.Text Private Sub C1_Click() Dim i As Integer i = Do While (1) If!isprime(i) Then i=i+1 Else Text1.Text = i Exit If End If Loop Private Sub C2_click() Open "c:\exam\2004\out5.txt" For Output As #1 Print #1,Text1.text Close #1 4 3 Read Calc Save Text1 MultiLine True ScrollBars 2 datain1.txt dataout.txt

258 248 3 sjt5.vbp ReadData Datain1.txt100 Arr WriteDate dataout.txt sjt5.vbp sjt5.frm Option Base 1 Dim Arr(100) As Integer Sub ReadData() Open App.Path &"\"&"datain1.txt"for Input As #1 For i = 1 To 100 Input #1,Arr(i) Next i Close #1 Sub WriteData(Filename As String, Num As Integer) Open App.Path &"\"& Filename For Output As #1 Print #1,Num Close #1 APP APP APP.Path 3Click 3 Option Base 1 Dim Arr(100) As Integer Dim a(100) Dim s As Integer Private Sub Read_Click() ReadData Private Sub Calc_Click() For i = 1 To 100 If Arr(i) >= 50 Then Text1.Text = Text1.Text + Str(Arr(i)) + " " s = s + Arr(i) End If Next i Print s Private Sub Save_Click() WriteData "Dataout.txt", s 5 sjt5.vbp Text1 Text2 3 C1 C2 C3

259 isprime a True False in5.txttext1 Text1 Text2 Text2out5.txt isprime Private Function isprime(a As Integer) As Boolean Dim flag As Boolean flag = True b% = 2 Do While b% <= Int(a / 2) And flag If Int(a / b%) = a / b% Then flag = False Else b% = b% + 1 End If Loop isprime = flag End Function isprime out5.txt 2003/9 Click Click isprime Dim a As Integer Private Sub C1_Click() Open "in5.txt" For Input As #1 Input #1,a Text1.Text = a Close #1 Private Sub C2_Click() Dim flag As Boolean, i As Integer a = a + 1 Do While Not isprime(a) a = a + 1 Loop Text2.Text = a

260 250 3 Private Sub C3_Click() Open "out5.txt" For Output As #1 Print #1,Text2.Text Close #1 6 sjt5.vbpform /9 Private Sub C1_Click(Index As Integer) ' Select Case? Case 1 Timer1.Enabled = False ' Case? Timer1.Enabled = True End Select Private Sub Timer1_Timer() ' Text1.Text = Text1.Text? Visual Basic sjt5.vbp Index0Index1 Index Enabled True False + 3Text1.Text = Text1.Text Interval Timer Private Sub C1_Click(Index As Integer) Select Case Index Case 1 Timer1.Enabled = False

261 Case 0 Timer1.Enabled = True End Select Private Sub Timer1_Timer() Text1.Text = Text1.Text sjt5.vbp ReadData1 ReadData2 datain1.txt datain2.txt 20 Arr1 Arr2 WriteData dataout.txtsjt5.vbp Form1 3 C1 C2 C3 ReadData1 ReadData2datain1.txt datain2.txt20 Arr1 Arr2 3 n 2 n 3 n n WriteDate dataout.txt dataout.txtsjt5.vbp sjt5.frm2003/9 Option Base 1 Dim Arr1(20) As Integer Dim Arr2(20) As Integer Sub ReadData1() Open App.Path & "\" & "datain1.txt" For Input As #1 For i = 1 To 20 Input #1, Arr1(i) Next i Close #1 Sub ReadData2() Open App.Path & "\" & "datain2.txt" For Input As #1 For i = 1 To 20 Input #1, Arr2(i)

262 252 3 Next i Close #1 Sub WriteData(Filename As String, Num As Integer) Open App.Path & "\" & Filename For Output As #1 Print #1, Num Close #1 C1 ReadData1 ReadData2 Click C2Arr3 20 Arr3Sum C3 Click C3 Click WriteData dataout.txt Sum Option Base 1 Dim Arr1(20) As Integer Dim Arr2(20) As Integer Dim Sum As Integer Private Sub C1_Click() Call ReadData1 Call ReadData2 Private Sub C2_Click() Dim Arr3(20) As Integer Sum = 0 For i = 1 To 20 Arr3(i) = Arr1(i) + Arr2(i) Sum = Sum + Arr3(i) Next i Print Sum Private Sub C3_Click() Call WriteData("dataout.txt", Sum) 8Text1 Command1 Command2 in5.txt 5 out.txt

263 in5.txt3 Name 8 Sex 4 Age Integer Private type StudInfo Name As String *8 Sex As String *4 Age As Integer End Type out5.txt sjt5.vbp sjt5.frm2003/9 StudInfoPrivate StudInfo Student in5.txt Open "in5.txt" For Random As #1 Len = Len(Student) Len = Len(Student) Text1.Text = Student.Name & Student.Sex & Student.Age & Chr(13) & Chr(10) & Text1.Text Chr(13) Chr(10)Chr(13) Chr(10) in5.txt out5.txt Command2 Click Randomin5.txt Get # Outputout5.txt Print # Write #Print # Write #

264 254 3 MultiLine True Private Type StudInfo Name As String * 8 Sex As String * 4 Age As Integer End Type Dim Student As StudInfo Private Sub Command1_Click() Open "in5.txt" For Random As #1 Len = Len(Student) For i = 1 To 5 Get #1, i, Student Text1.Text = Student.Name & Student.Sex & Student.Age & Chr(13) & Chr(10) & Text1.Text Next i Close #1 Private Sub Command2_Click() Open "in5.txt" For Random As #1 Len = Len(Student) Open "out5.txt" For Output As #2 Len = Len(Student) For i = 1 To 5 Get #1, i, Student Print #2, Student.Name; Student.Sex; Student.Age Next i Close #1 Close #2 9 Form1 3Label1 Label2 Label3 3 Text1 Text2 Text3 Command1 Command2 in5.txt 3 3out5.txt out5.txt3 Name 8 Tel 10 Post Long

265 Private Type PalInfo Name As String *8 Tel As String *10 Post As Long End Type Dim Pal As PalInfo in5.txt 333 out5.txt2 Private Sub Command2_Click() Open "out5.txt" For Output As #1 Print #1,Text1.Text, Text2.Text, Text3.Text Close 1 sjt5.vbp sjt5.frm 2003/9 Private Type PalInfo Name As String * 8 Tel As String * 10 Post As Long End Type Dim Pal As PalInfo in5.txtlen = Len(Pal) Len(Pal) Pal Open "in5.txt" For Random As #1 Len = Len(Pal) 3 Get #1, 3, Pal out5.txt Open "out5.txt" For Output As #1

266 256 3 Input# Line Input# Print# Write# Get# Put# Type PalInfo Name As String * 8 Tel As String * 10 Post As Long End Type Dim Pal As PalInfo Private Sub Command1_Click() Open "d:\01.dat" For Random As #1 Len = Len(Pal) Get #1, 3, Pal Text1.Text = Pal.Name Text2.Text = Pal.Tel Text3.Text = Pal.Post Close #1 Private Sub Command2_Click() Open "d:\out5.txt" For Output As #1 Print #1, Text1.Text, Text2.Text, Text3.Text Close #1 10 sjt5.vbp in5.txt15 atext1 Text1 Text1 Text2 Text2 Text1Text2 2003/9

267 Dim a(15) As String Private Sub C1_Click() Dim k As Integer Open "in5.txt" For Input As #1 Form1.Cls For k = 1 To 15 Input #1, a(k) Print a(k) Next k ' Close? Private Sub C2_Click() Dim k As Integer, n As Integer, c As String ' n = Len(? ) c = "" If n > 0 Then For k = 1 To 15 ' If Left(a(k),? ) = Text1.Text Then ' c = c + " " +? End If Next k If c = "" Then Text2.Text = "" Else ' Text2.Text =? End If Else Text2.Text = "" End If Len Left 1 #1 2 Text1.Text 3c a(k) 4 Text2 c Dim a(15) As String Private Sub C1_Click() Dim k As Integer

268 258 3 Open "in5.txt" For Input As #1 Form1.Cls For k = 1 To 15 Input #1, a(k) Print a(k) Next k Close #1 Private Sub C2_Click() Dim k As Integer, n As Integer, c As String n = Len( Text1.Text ) c = "" If n > 0 Then For k = 1 To 15 If Left(a(k), n) = Text1.Text Then c = c + " " + a(k) End If Next k If c = "" Then Text2.Text = "" Else Text2.Text = c End If Else Text2.Text = "" End If 11 sjt5.vbp Text1 Text2 3 C1 C2 C3 in5.dat 50 Text150 Text2 50 out5.dat Click 2003/9

269 Dim a(50) As Integer Private Sub C1_Click() Dim k As Integer, ch As String Open "in5.dat" For Input As #1 ch = "" For k = 1 To 50 ' Input #1,? ch = ch + Str(a(k)) + " " Next k Close #1 ' Text1.Text =? Private Sub C2_Click() Private Sub C3_Click() Open "out5.dat" For Output As #1 Print #1, Text2.Text Close #1 1For 50 a ch a(k) 2a ch Text1ch Text1 Text Click a n n 1 Dim a(50) As Integer Private Sub C1_Click() Dim k As Integer, ch As String Open "in5.dat" For Input As #1 ch = "" For k = 1 To 50 Input #1, a(k) ch = ch + Str(a(k)) + " " Next k Close #1 Text1.Text = ch Private Sub C2_Click() Dim i As Integer, j As Integer, num As Integer

270 260 3 Dim ch As String For i = 1 To 49 For j = 49 To i Step 1 If a(j + 1) < a(j) Then num = a(j + 1) a(j + 1) = a(j) a(j) = num End If Next j Text2.Text = Text2.Text + Str(a(i)) + " " Next i Private Sub C3_Click() Open "out5.dat" For Output As #1 Print #1, Text2.Text Close #1 12sjt5.vbp L1 L2C1 Text1 Text2 Text1 * Text23 C1 Text Text1 Text /9 Private Sub C1_Click() ' If? = "123456" Then Text1.Text = "" ' Text1.? = "" Else Text2.Text = Text2.Text 1 ' If Text2.Text >? Then MsgBox " " & (3 Text2.Text) & " " Else

271 MsgBox "3 " ' Text1.Enabled =? End If End If 1Text1 Text1.Text 2PasswordChar"" Text1 3Text Text1 * Text1 PasswordChar* Text Private Sub C1_Click() If Text1.Text = "123456" Then Text1.Text = "" Text1. PasswordChar = "" Else Text2.Text = Text2.Text 1 If Text2.Text > 0 Then MsgBox " " & (3 Text2.Text) & " " Else MsgBox "3 " Text1.Enabled = False End If End If 13 3 Read Calc Save Text1 MultiLine True ScrollBars 2 datain1.txt100 1 dataout.txt

272 262 3 sjt5.vbp ReadData datain1.txt100 Arr WriteData dataout.txt 2004/4 Option Base 1 Dim Arr(100) As Integer Sub ReadData() Open App.Path & "\" & "datain1.txt" For Input As #1 For i = 1 To 100 Input #1, Arr(i) Next i Close #1 Sub WriteData(Filename As String, Num As Integer) Open App.Path & "\" & Filename For Output As #1 Print #1, Num Close #1 4 3Click Calc ClickText1.Text = Text1.Text + "Arr(" + Str(i) + ") = " + Str(Arr(i)) + Chr(13) + Chr(10) 3 Option Base 1 Dim Arr(100) As Integer Dim a(100) Dim s As Integer Private Sub Read_Click() ReadData Private Sub Calc_Click() For i = 2 To 100 If i Mod 2 = 0 Then Text1.Text = Text1.Text + "Arr(" + Str(i) + ") = " + Str(Arr(i)) + Chr(13) + Chr(10) s = s + Arr(i) End If Next i Print s Private Sub Save_Click() WriteData "Dataout.txt", s

273 >>>>

274 Visual Basic ABCD 1 A Visual Basic B Visual Basic C Visual Basic Width Height D Visual Basic 2 A B.BAS C D 3 A DblCLick B CMouseMove D 4Visual Basic A.frm B.bat C.vbg D.vbp 5 A B Visual Basic C Visual Basic

275 D 6TelBook A Type TelBook Name As String*10 TelNum As Integer End Type C Type TelBook Name String*10 TelNum Integer End Type TelBook B Type TelBook Name As String*10 TelNum As Integer End TelBook D Typedef TelBook Name String*10 TelNum Integer End Type 7 A Const var 1=123 C DefInt a-z B Dim var2= ABC D Static var3 As Integer 8 List1 A List1.List B List1.ListIndex C List1.Index D List1.Text 9 A MouseDown B MouseUp C Load D Click 10a=10, b=5, c=1, Print a>b>c A True B False C 1 D 11 A Caption B Name C BackColor D BorderStyle 12 A BOF B LOC C LOF D EOF 13 ASub Main B CHide D 14MouseDown Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 4

276 A Button B ShiftShift C ShiftAlt Ctrl D X Y 15 Combo13 A Combo1.RemoveItem Text B Combo1.RemoveItem 2 C Combo1.RemoveItem 3 D Combo1.RemoveItem Combo1.Listcount 16 A TabStop False B LostFocus CEnabled False Tab DTabIndexTab 17Caption A = B * C & D - 18 Open "Tel.dat" For Random As #1 Len=50 Tel.dat A C B D 19 Command1 Text1 Text2 : Private Sub Command1_Click() n=text1.text Select Case n Case 1 To 20 x=10 Case 2, 4, 6 x=20 Case Is <10 x=30 Case 10 x=40 End Select Text2.Text=x Text1 10Text2

277 A 10 B 20 C 30 D Do Loop While<> A0 B C Exit Do DTrue 21 Command1: Private Sub Command1_Click() Dim num As Integer num = 1 Do Until num > 6 Print num; num=num Loop A B C D 22 Command1: Private Sub Command1_Click() Dim a As Integer, s As Integer a = 8 s = 1 Do s = s + a a = a 1 Loop While a <= 0 Print s; a A 7 9 B 34 0 C 9 7 D 23 : Public Function f(x As Integer) Dim y As Integer

278 x=20 y=2 f=x*y End Function Command1: Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x;y A 10 5 B 20 5 C D : Public Sub Fun (a(),byval x As Integer) For i =1 To 5 x=x+a(i) Next Text1Command1 Private Sub Command1_Click() Dim arr(5) As Variant For i=1 To 5 arr(i)=i Next n=10 Call Fun(arr(),n) Text1.Text=n A 10 B 15 C 25 D Command1: Option Base 1 Private Sub Command1_Click() d=0 c=10

279 x=array(10, 12, 21, 32, 24) For i= 1 To 5 If x(i) > c Then d=d+x(i) c=x(i) Else d=d c End If Next i Print d A 89 B 99 C 23 D HScroll1 HScroll2 6 Label1 Label2 Label3 Label4 Label5 Label6 Label4~Label6A B A*BLabel1 Label2 Label3A*B Label1 Label2 Label3 A Private Sub Command1_Click() Label3.Caption=Str(Val(Label1.Caption)*Val(Label2.Caption)) B Private Sub Command1_Click() Label3.Caption= Hscro1ll.Value* HScroll2.Value C Private Sub Commandl_Click() Label3.Caption=HScroll1*HScroll2 D Private Sub Command1_Click() Label3.Caption=HScroll1.Text * HScroll2.Text 27 Command1 Private Sub Command1_Click() For n = 1 To 20

280 If n Mod 3 <> 0 Then m = m + n \ 3 Next n Print n A 15 B 18 C 21 D Text1 Private Sub Form_Load() Show Text1.Text = "" Text1.SetFocus Private Sub Form_MouseUP(Button As Integer,Shift As Integer,X As Single, Y As Single) Print "" Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Print "Visual Basic"; A A Visual Basic C A B D Visual Basic 29 Private Sub Command1_Click() Dim sum As Double, x As Double sum = 0 n = 0 For i = 1 To 5 x = n / i n = n + 1 sum = sum + x Next For A 1+1/2+ 2/3+3/4+4/5 B 1+1/2+2/3+3/4 C 1/2+2/3+3/4+4/5 D 1+1/2+1/3+ 1/4+1/5 30 A Static arr1(3)

281 arr1(1) = 100 arr1(2) = "Hello" arr1(3) = B Dim arr2() As Integer Dim size As Integer Private Sub Command2_Click() size = InputBox(" ") ReDim arr2(size) C Option Base 1 Private Sub Command3_Click() Dim arr3(3) As Integer D Dim n As Integer Private Sub Command4_Click() Dim arr4(n) As Integer i 1 s 2 s=2 For i=3.2 To 4.9 Step 0.8 s=s+1 Next i 2 KeyPreview True Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Print Chr(KeyCode) Private Sub Form_KeyPress (KeyAscii As Integer) Print Chr(KeyAscii) AShift 3 4 3Label1 Timer1 Private Sub Form_Load() Timer1.Enabled= False

282 Timer1.Interval= 5 Private Sub Form_Click() Timer1.Enabled= 6 Private Sub Timer1_Timer() Label1.Caption= 7 1 4Text1 Label1 Command1 : Private Sub Command1_Click() S$=InputBox("") Text1.Text=S$ Private Sub Text1_Change() Label1.Coption=Ucase(Mid(Text1.Text,7)) VisualBasic 8 5List1 Command1 Label1 Private Sub Commandl_Click() If List1 ListIndex >= 9 Then List1.RemoveItem 10 Label1.Caption= 11 Else MsgBox " " End If

283 Option Base 1 Private Sub Command1_Chick() Dim arr1, Max as Integer arr1=array(12,435,76,24,78,54,866,43) 12 =arr1(1) For i=1 To 8 If arr1(i)> Max Then 13 Next i Print ":";Max Array8 7smtextl.txt Text1 Private Sub Command1_Click() Dim indata As String Text1.Text="" Open ".\smtext1.txt" 14 As #1 Do While 15 Input #1,inData Text1.Text=Text1.Text&inData Loop Close #1

284 C A B DC Timer Width Height 2 A 4 A 3 B A CDName B 4 B 4.frm.vbg.vbp Visual Basic.bat Visual Basic 5 C C Visual Basic Visual Basic.exeVisual Basic Windows 6 A 7 B Const Dim DefIntDefType Static B 8 D 4 List

285 ListIndex Index Text D 9 C 10 B a > b > c a > b True True > c True Visual Basic0 TrueFalse 11 A 12 D BOF Visual Basic 3 LOC LOF EOFTrue False D 13 A A Main Sub Main Main 14 A 15 B RemoveItem 03 2 B 16 A GetFocus LostFocus Enabled Visible True TabTabIndex Tab TabIndex TabTab TabStop FalseTab Tab Tab

286 A 17 D 18 C 19 A Select Casen Case Case Text A 21 B num B 22 C 23 C xf 20y f 40C 24 A n C x(i) > c 26 D TextDC Value 27 C Mod\ 28 D Form_LoadText1AText1 KeyDown Visual Basic D 29 C 30 D D For 3i= s5 3 A 4 a

287 KeyPreview True KeyPressKyeAscii Ascii AKeyAscii=97 a Shift+A KeyAscii=65 A KeyDownKeyCode AKeyCode=65 AShift+A KeyDownKeyCode 16 Shift 65 A AA a True 7 Time Time$ 5LoadTimer1 1Timer1 Interval Timer1 Enabled True 7 TimerTime Label1 Caption 8 BASIC Ucase(Mid(Text1.Text,7)) Text1.Text7 VisualBasic BASIC List1.ListIndex 11 List1.ListCount 9 List1 ListIndex 0 10 RemoveItem List1.ListIndex 11ListCount Label1 Caption 12 Max 13 Max = arr1(i) 14 For Input 15 Not EOF(1) 14 Open InputFor Input 15 Do While Loop Do WhileNot EOF(1)

288 Visual Basic C:\WEXAM\ Visual Basic 1Form1P pic1.bmp sjt1.vbp sjt1.frm 2 Form1Text1 Text2 C1 Text1 Text1 Text2 sjt2.vbp sjt2.frm C:\WEXAM\

289 sjt3.vbp Private Sub C1_Click() ' For i =? To? ' If Op1(i).? = True Then ' Print "" + Op1(i).? End If Next 2 sjt4.vbp Private Sub c1_click() Dim flag As Boolean ' For i =? To Cb1.ListCount 1 ' If Cb1.List(i) = Cb1.? Then flag = True

290 Else flag = False End If Next If flag Then MsgBox "" Cb1.Text = "" Else ' Cb1.? Cb1.Text End If C:\WEXZM\ in5.txtform1 Text1 C1 in5.txt out5.txt sjt5.vbpsjt5.frm C:\WEXAM\ Visual Basic 1 Form1 Text1

291 sjt1.vbp sjt1.frm 2 Form1Cmd1 Cmd2 Cmd1 Cmd2 2 sjt2.vbp sjt2.frm C:\WEXAM\ sjt3.vbp sjt3.frm Command1

292 Option Base 1 Private Sub Command1_Click() Dim arrn(30) As Integer Dim Max As Integer Randomize For i = 1 To 30 ' arrn(i) = Int(Rnd *?) Next i '? = arrn(1) For i = 2 To 30 ' If? Then Max = arrn(i) End If Next i Print Max 2 sjt4.vbp sjt4.frm Fun Function Fun() End Function Sub SaveData() Open App.Path & "\" & "outtxt.txt" For Output As #1 Print #1, Text1.Text Close #1 Function Fun() End Function Private Sub Command1_Click() d = Fun() Text1.Text = d SaveData C:\WEXZM\ sjt5.vbp sjt5.frm datain.txt datain.txt Mat 5 5

293 Option Base 1 Private Sub Form_Click() Const N = 5 Const M = 5 ' Dim? Dim i, j ' Open App.Path & "\" & "datain.txt"? As #1 For i = 1 To N For j = 1 To M '? Next j Next i Close #1 Print Print "" Print For i = 1 To N For j = 1 To M Print Tab(5 * j); Mat(i, j); Next j Print Next i Print Print " " For i = 1 To N For j = 1 To M ' If? Then Print Tab(5 * j); Mat(i, j); Next j Next i

294 ScrollBars 3MultiLineTrue ScrollBars 3MultiLine True ClickText1 Text Text2 Text Private Sub Command1_Click() Text2.Text = Text1.Text 2 1 Private Sub C1_Click() For i = 0 To 2 If Op1(i). Value = True Then Print "" + Op1(i). Caption End If Next Text Text 3 AddItem

295 Private Sub c1_click() Dim flag As Boolean For i = 0 To Cb1.ListCount 1 If Cb1.List(i) = Cb1. Text Then flag = True Exit For Else flag = False End If Next If flag Then MsgBox "" Cb1.Text = "" Else Cb1. AddItem Cb1.Text End If 3 APP APP Visual Basic APP.Path.vbpAPP.Path EOF EOFTrue FalseDo While Not EOF(1) Line Input #strx Chr(13) + Chr(10) Text1 MultiLine True Private Sub Form_Load() Dim strx As String, stry As String Open App.Path & "\" & "in5.txt" For Input As #1 Do While Not EOF(1) Line Input #1, strx stry = stry + strx + Chr(13) + Chr(10) Loop Text1.Text = stry Close #1 Private Sub Command1_Click() Open App.Path & "\" & "out5.txt" For Output As #1 Write #1, Text1.Text

296 Close #1 1 1 MultiLine True Scrollbars 2 Text Font Caption 2 Left Top Cmd1Cmd1 ClickLeft Top 0 Cmd22 Click Cmd2.Height = 2 * Cmd2.Height Cmd2.Width = 2 * Cmd2.Width Private Sub Cmd1_Click() Cmd1.Left = 0 Cmd1.Top = 0 Private Sub Cmd2_Click() Cmd2.Height = 2 * Cmd2.Height

297 Cmd2.Width = 2 * Cmd2.Width 2 1 1Rnd Rnd Randomize 2Max MaxMax 3 If Max arrn(i) > Max Max < arrn(i) Option Base 1 Private Sub Command1_Click() Dim arrn(30) As Integer Dim Max As Integer Randomize For i = 1 To 30 arrn(i) = Int(Rnd * 1000 ) Next i Max = arrn(1) For i = 2 To 30 If arrn(i) > Max Then Max = arrn(i) End If Next i Print Max 2 Fun Function Fun() Dim a As Integer, i As Integer a = 0 For i = 5 To 1000 If (i Mod 5 = 0) Or (i Mod 7 = 0) Then a = a + 1 End If Next i Fun = a End Function

298 Max(N,M) Max(M,N) 2 Input 3Input #1, Mat(i, j)i j i = j i = j Option Base 1 Private Sub Form_Click() Const N = 5 Const M = 5 Dim Mat(N, M) As Integer Dim i, j Open App.Path & "\" & "datain.txt" For Input As #1 For i = 1 To N For j = 1 To M Input #1, Mat(i, j) Next j Next i Close #1 Print Print "" Print For i = 1 To N For j = 1 To M Print Tab(5 * j); Mat(i, j); Next j Print Next i Print Print " " For i = 1 To N For j = 1 To M If i = j Then Print Tab(5 * j); Mat(i, j); Next j Next i

299 Visual Basic ABCD 1 Text1 A Text1.Maxlength=0 C Text1.Visible=False B Text1.Enabled=False D Text1.Width=0 2 Form1Visual Basic A Form1.Name="Visual Basic" B Form1.Title="Visual Basic" C Form1.Caption="Visual Basic" D Form1.Text="Visual Basic" 3 Text1 HScroll1 Min Max A Private Sub HScroll_Change() Text1.Text=HScroll1.value B Private Sub HScroll_Click() Text1.Text=HScroll1.value

300 C Private Sub HScroll_Change() Text1.Text=HScroll.Caption D Private Sub HScroll_Click() Text1.Text=HScroll.Caption 4 Open Alt O Open Open ACaption &Open BCaption O&pen CName &Open DName O&pen 5 Command1 Private Sub Command1_Click() x=inputbox("input") Select Case x Case 1,3 Print " 1" Case Is >4 Print " 2" Case Else Print "Else " End Select 2 A 1 B 2 C Else D 6 MsgBox A MsgBox B MsgBox C MsgBox D MsgBox 7 Timer1 0.5 A Timer1.InterVal=0.5 C Timer.Interval=50 B Timer1.Interval=5 D Timer1.Interval=500

301 Command1 Private Sub Command1_Click() Static x As Integer Cls For i=1 To 2 y=y+x x=x+2 Next Print x,y 3 Command1 A 4 2 B C D AHide B C D 10 A B C D LOF 11 A B C D 12Visual Basic A ForLoop B Const C 9abc D a#x 13value A 3 B 2 C 1 D Mod 3+3\5*2 A 0 B 2 C 4 D 6 15x=4 y=8 z=7x<y And (Not y>z) Or z<x

302 A 1 B -1 C True D False 16 Command1 Private Sub Command1_Click() a$="visualbasic" Print String(3,a$) A VVV B Vis C sic D x=2 For i=1 To 10 Step 2 x=x+i Next x A 26 B 27 C 38 D AKeyPress BKeyPress CKeyDown KeyUp A a DKeyDown KeyUp a= Print Format(a,"$00,00.00") A 0, B $9.86 C 9.86 D $0, CommandDialog1Command1 Private Sub Command1_Click() CommonDialog1.FileName ="" CommonDialog1.Filter="All file *.* (*.Doc) *.Doc (*.Txt) *.Txt" CommonDialog1.FilterIndex=2 CommonDialog1.DialogTitle="VBTest" CommonDialog1.Action=1

303 A B C VBTest D*.Txt 21Form1 Form2Form1 Command1Form1 Private Sub Command1_Click() Dim a As Integer a=10 Call g(form2,a) Private Sub g(f As Form,x As Integer) y=iif(x>10,100,-100) f.show f.caption=y A Form1 Caption100 C Form1 Caption 100 B Form2 Caption 100 D Form2 Caption Command1 Private Sub Command1_Click() Dim x As Integer Static y As Integer x=10 y=5 Call f1(x,y) Print x,y Private Sub f1(byref x1 As Integer, y1 As Integer) x1=x1+2 y1=y1+2 A 10 5 B 12 5 C 10 7 D Option Base 1 Private Sub Command1_Click() Dim a(10) As Integer Dim n As Integer

304 n=inputbox("") If n<10 Then Call GetArray(a,n) End If Private Sub GetArray(b() As Integer,n As Integer) Dim c(10) As Integer j=0 For i=1 To n b(i)=cint(rnd()*100) If b(i)/2=b(i)\2 Then j=j+1 c(j)=b(i) End If Next Print j A bc B c C GetArray n D10 24 Command1 Option Base 1 Private Sub Command1_Click() Dim a a= Array(1,2,3,4,5) For i=1 To UBound(a) a(i) = a(i)+i-1 Next Print a(3) A 4 B 5 C 6 D 7 25 Option Base 1 Private Sub Form_Click() Dim arr,sum Sum = 0 arr = Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10

305 If arr(i)/3 = arr(i)\3 Then Sum =Sum+arr(i) End If Next I Print Sum A 13 B 14 C 27 D File1 Private Sub File1_DblClick() x=shell(file1.filename,1) A xcall Shell(File1,FileName,1) B CFile1.FileName D File1 27 Label1 VisualBasic Command1 Command2 Timer1Interval 500 Private Sub Form_Load() Timer1.Enabled=False Private Sub Command1_Click() Timer1.Enabled=True Private Sub Timer1_Timer() If Label1.Left<Width Then Label1.Left = Label1.Left + 20 Else Label1.Left=0 End If

306 A B C D 28 a$="abbacddcba" For i=6 To 2 Step 2 X=Mid(a,i,i) Y=Left(a,i) z=right(a,i) z=ucase(x&y&z) Next I Print z A ABA B BBABBA C ABBABA D AABAAB 29 Command1 Option Base 1 Private Sub Command1_Click() Dim a As Variant a=array(1,2,3,4,5) Sum=0 For i=1 To 5 Sum = sum+a(i) Next I x=sum/5 For i =1 To 5 If a(i)>x Then Print a(i); Next I A 1 2 B C D Form1 Model1 Model2 Model1 Public x As Integer Public y As Integer

307 Sub S1() x =1 S2 Sub S2() y=10 Form1.Show End Show Model2 Sub Main() S1 Sub Main A Form1 Model1 Model2 B Model1 Model2 Form1 C Model2 Model1 Form1 D Model2 Form1 Model a$="beijingshanghai" b$=mid(a$,instr(a$,"g")+1) b$ num =0 While num<=2 num = num+1 Wend Print num 3List1Text1 Label1 Caption Sum Command List1

308 Private Sub Form_Load() For i=1 To 100 If i Mod 7 =0 Then 3 End If Next Private Sub Command1_Click() Sum =0 For i=0 To 4 Sum =Sum+ 5 Next Text1.Text=Sum Text1 Text2 Text3 Text1 Private Sub Command1_Click() Randomize n=cint(text1.text) n1=0 n2=0 For i=1 To 6 r=int(rnd*2) If r= 7 Then n1=n1+1 Else n2=n2+1 End If Next Text2.Text=n1 Text3.Text=n2

309 Option Base 1 Private Sub Form_Click() Dim a(3) As Integer Print " "; For i=1 To 3 a(i)=inputbox("") Print a(i); Next Print If a(1)<a(2) Then t=a(1) a(1)=a(2) a(2)= 8 End If If a(2)>a(3) Then m=a(2) ElseIf a(1)>a(3) Then m= 9 Else m= 10 End If Print " ";m Command17 5Label1 Label2 Caption Label3 5 Label2

310 Private Sub Command1_Click() Sum = 0 For i=0 To 4 Sum=Sum+ 11 Next 12 =Sum 7 Command1 Command2 a a Option Base 1 Dim a(3,2) As Integer Private Sub Command1_Click() For i=1 To 3 For j=1 To 2 13 =i+j Next j Next I Private Sub Command2_Click() For j=1 To 3 For i=1 To 2 s=s+ 14 Next I Next j Text1.Text= 15

311 B Enabled True False 2 C 3 A 4 A 5 C Visual Basic Case x x=1 3 1 x>4 2 x Else2 Else C 6 D MsgBox1 7 7A MsgBox type B MsgBox MsgBox C MsgBox D 7 D 8 B x y x y 3 Command1 x y x = 4 y = 2 x = 8 y = 10 x = 12 y = 18 9 A 10 B

312 B 11 D Visual Basic D 12 A 13 C Value B 5 Mod \ 5 * 2 = (5 Mod 3) + (3 \ 5) * 2 = * 2 = 2 B 15 D ((x < y) And (Not(y > z))) or (z < x) True False False False False 16 A String(3,a$)a3 String(3,a$) = VVV 17 B 18 B KeyPressKeyAsciiAscii A a Ascii 0 9Ascii KeyPress Ascii Ascii KeyDown KeyUp KeyCode A a 0 9KeyDown KeyUp B 19 D Print $

313 , D 20 D FileName Filter FilterIndex Filter *.Doc DialogTitle Action 1 D 21 B Visual Basic Form Control x = 10y = 100g Form2 Caption D ByVal x1 y1 f1x yd 23 C GetArrayn CInt() b(i) / 2 = b(i) \ 2 b(i)b(i) 24 B a = Array(1,2,3,4,5)a Dim a Dim a()a Ubound()1 5

314 B 25 C A FileName Shell(File.FileName,1) 1 File.FileName 1 x = Shell(File.FileName,1) x ID ID Shell(File.FileName,1) DblClick Shell 27 A Label1.Left < Width Width TimerLeft20 Left 0 28 B z X Y Z i=2x = Mid(a,i,i) = bb Y = Left(a,i) = ab z = Right(a,i) = ba z = UCase(X&Y&z) = BBABBA 29 D 30 C Main Model2 Model2Model1 S1S1S2 S2Form1 Model2 Model1 Form "Shanghai" Mid 2 InStr(a$,"g")+1 g S Mid3 b$shanghai 2 3 While num1 While num = 3

315 List1.AddItem i 4 List1.ListCount-1 5 List1.List(i) 17AddItem List1.AddItem i 2 ListCount 0 ListCount 1 3 List1.List(i) 6 n 7 1 n = Cint(Text1.Text) r = Int(Rnd * n) t 9 a(3) 10 a(1) 3 a(1) < a(2)tt a(2) a(2) > a(3) a(2)m a(2) a(1) > a(3)a(3) a(3)m a(1) a(1)m 11 label1(i).caption 12 label2.caption 13 a(i,j) 14 a(j,i) 15 s Command1_Click Command2_Click i j

316 Visual Basic C:\WEXAM\ Visual Basic 1 Forml HScrolll 1~100Labell Label sjt1.vbp sjt1.frm 2 Forml Shapel Commandl Command2 Click &HFF& &HC000& sjt2.vbp sjt2.frm

317 C:\WEXAM\ sjt3.vbp Commandl Command2 3 Optionl Option2 Option3 1in3.dats 2 3s 4 Click Dim s As String Private Sub Command1_Click() Open "in3.dat" For Input As #1 s = Input$(LOF(1), #1) Close #1 Private Sub Command2_Click() ' Private Sub Form_Unload(Cancel As Integer) Open "out3.dat" For Output As #1 Print #1, Option1.Value, Option2.Value, Option3.Value, Text1.Text Close #1

318 sjt4.vbp Picturel Picture2 Dim m As Integer Private Sub Command1_Click() Picture1.Visible = False Picture2.Visible = True ' Timer1.Enabled =? Private Sub Command2_Click() Picture2.Visible = False Picture1.Visible = True Timer1.Enabled = False Private Sub Command3_Click(Index As Integer) ' m =? Private Sub Timer1_Timer() ' Select Case? Case 0: Picture3.Move Picture3.Left + 10 Case 1: Picture3.Move Picture3.Left - 10 Case 2: Picture3.Move Picture3.Left, Picture3.Top - 10 Case 3: Picture3.Move Picture3.Left, Picture3.Top + 10 End Select

319 C:\WEXAM\ a b a b sjt5.vbp 3 Text1 Text2 Text3 3 Commandl Command2 Command3in5.dat xtextl a b a x batext2 btext3 Text2 Text1 Text3 isprime(x)x True FalseClick out5.dat Private Sub Command1_Click() Dim x As Integer Open "in5.dat" For Input As #1 Input #1, x Close #1 Text1 = x Private Sub Command2_Click() ' Private Sub Command3_Click() Open "out5.dat" For Output As #1 Print #1, Text2, Text3 Close #1 Function isprime(x As Integer) Dim k As Integer, flag As Boolean k = 2 flag = True While k <= Int(x / 2) And flag

320 If Int(x / k) = x / k Then flag = False Else k = k + 1 End If Wend isprime = flag End Function C:\WEXAM\ Visual Basic 1Forml Op Dis Clea sjt1.vbp sjt1.frm 2FormlLabl L1 sjt2.vbp sjt2.frm ` C:\WEXAM\ sjt3.vbp,,f1

321 F2,F1Op1 Op2 F2Op3 Op4 Textl sjt3.vbp,sjt3.frm Private Sub Form_Unload(Cancel As Integer) Open "out3.txt" For Output As #1 Print #1, Op1.Value, Op2.Value, Op3.Value, Op4.Value, Text1.Text Close #1 2 sjt4.vbp Text1 Text2 Lab Op1 Op2 Text1 Text2 Text1 Text2 Text1 Text2 sjt4.vbp sjt4.frm

322 Private Sub Form_Unload(Cancel As Integer) Open "out4.txt" For Output As #1 Print #1, Op1.Value, Op2.Value, Text1.Text, Text2.Text, Lab1.Caption Close # C:\WEXAM\ sjt5.vbp Form1 3C1 C2 C3 ReadData1 ReadData2datain1.txt datain2.txt 20 Arr1 Arr2 n nn n WriteDatadataout.txt dataout.txt Option Base 1 Dim Arr1(20) As Integer Dim Arr2(20) As Integer Sub ReadData1() Open App.Path & "\" & "datain1.txt" For Input As #1 For i = 1 To 20 Input #1, Arr1(i)

323 Next i Close #1 Sub ReadData2() Open App.Path & "\" & "datain2.txt" For Input As #1 For i = 1 To 20 Input #1, Arr2(i) Next i Close #1 Sub WriteData(Filename As String, Num As Integer) Open App.Path & "\" & Filename For Output As #1 Print #1, Num Close #1

324 Min Max Caption Shape 3-Circle Heigth Width Caption Command1_Click() Command2_Click()BorderColor Private Sub Command1_Click() Shape1.BorderColor = &HFF& Private Sub Command2_Click() Shape1.BorderColor = &HC000& Command2_Click() Value True Mid$(s, i, 1) s i 1 If Then ElseIf For Next Private Sub Command2_Click() Dim count As Integer count = 0 If Option1.Value = True Then For i = 1 To Len(s) If Mid$(s, i, 1) >= "A" And Mid$(s, i, 1) <= "Z" Then count = count + 1 End If Next i

325 ElseIf Option2.Value = True Then For i = 1 To Len(s) If Mid$(s, i, 1) >= "a" And Mid$(s, i, 1) <= "z" Then count = count + 1 End If Next i Else For i = 1 To Len(s) If Mid$(s, i, 1) = " " Then count = count + 1 End If Next i End If Text1.Text = count 2 4 Index Move Object.Move left,top,width,height left Dim m As Integer Private Sub Command1_Click() Picture1.Visible = False Picture2.Visible = True Timer1.Enabled = True Private Sub Command2_Click() Picture2.Visible = False Picture1.Visible = True Timer1.Enabled = False Private Sub Command3_Click(Index As Integer) m = Index Private Sub Timer1_Timer() Select Case m Case 0: Picture3.Move Picture3.Left + 10 Case 1: Picture3.Move Picture3.Left - 10 Case 2: Picture3.Move Picture3.Left, Picture3.Top - 10 Case 3: Picture3.Move Picture3.Left, Picture3.Top + 10 End Select

326 Click Whilei i 11 i Command1_Click() x Dim Command2_Click()Text1.Text Val Command2_Click() 2 Private Sub Command2_Click() Dim x As Integer Dim i As Integer x = Val(Text1.Text) i = x While Not isprime(i) i = i - 1 Wend Text2.Text = i i = x + 1 While Not isprime(i) i = i + 1 Wend Text3.Text = i 1. 1Print [.]Print [][, ;] Cls [.]Cls Private Sub dis_click() Print "" Private Sub clea_click() Cls

327 ListCount Caption DblClick()Lab1.Caption = L1.ListCount Private Sub L1_DblClick() Lab1.Caption = L1.ListCount 2. 1 If4 If Then ElseIf If Then Click() Private Sub Text1_Click() If Op1.Value = True And Op3.Value = True Then Text1.Text = " " + Op1.Caption + " " + Op3.Caption ElseIf Op1.Value = True And Op4.Value = True Then Text1.Text = " " + Op1.Caption + " " + Op4.Caption ElseIf Op2.Value = True And Op3.Value = True Then Text1.Text = " " + Op2.Caption + " " + Op3.Caption ElseIf Op2.Value = True And Op4.Value = True Then Text1.Text = " " + Op2.Caption + " " + Op4.Caption End If 2If Height Width Click() Private Sub Form_Click() Dim str As String If Op1.Value = True Then str = Text1.Text Text1.Text = Text2.Text Text2.Text = str Lab1.Caption = "" ElseIf Op2.Value = True Then Lab1.Caption = Text1.Text + Text2.Text End If 3. Visual BasicCall

328 Sum 3 Dim Sum As Integer Private Sub C1_Click() Call ReadData1 Call ReadData2 Private Sub C2_Click() Dim Arr3(20) As Integer Sum = 0 For i = 1 To 20 Arr3(i) = Arr1(i) \ Arr2(i) Sum = Sum + Arr3(i) Next i Print Sum Private Sub C3_Click() WriteData "dataout.txt", Sum

VB程序设计教程

VB程序设计教程 高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处

More information

2010年3月计算机等级考试四级网络工程师笔试

2010年3月计算机等级考试四级网络工程师笔试 计 算 机 二 级 VB 经 典 预 测 题 下 列 各 题 A) B) C) D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的 请 将 正 确 选 项 填 涂 在 答 题 卡 相 应 位 置 上, 答 在 试 卷 上 不 得 分 (1) 下 列 叙 述 中 正 确 的 是 ( ) A) 循 环 队 列 是 队 列 的 一 种 链 式 存 储 结 构 B) 循 环 队 列 是 队

More information

《Visual Basic程序设计》实验课

《Visual Basic程序设计》实验课 Visual Basic Visual Basic [email protected] 0 Visual Basic 1 0...1 1 Visual Basic...2 2...3 3...6 4...9 5...13 6...16 7...18 8...22 9...24 10...27 11...29 12 API...31 13...34 14...35 15...38 1 1 Visual

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

More information

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344> 1. 請 問 誰 提 出 積 體 電 路 (IC) 上 可 容 納 的 電 晶 體 數 目, 約 每 隔 24 個 月 (1975 年 更 改 為 18 個 月 ) 便 會 增 加 一 倍, 效 能 也 將 提 升 一 倍, 也 揭 示 了 資 訊 科 技 進 步 的 速 度? (A) 英 特 爾 (Intel) 公 司 創 始 人 戈 登. 摩 爾 (Gordon Moore) (B) 微 軟 (Microsoft)

More information

MVB-1001.DOC

MVB-1001.DOC 20 1.5 10 15 20 25 80 100 CSF 1. 2. 0105 3. 4. 5. 30% 1.5 0.75 1. Visual Basic Visual Basic (A) Visual Basic Enterprise Edition (B) Visual Basic Script Edition (C) Visual Basic Learning Edition (D) Visual

More information

穨ac3-3.PDF

穨ac3-3.PDF 3-1 Access 3-1-1 Event Click OnClick Click OnClick AfterUpdate BeforeUpdate On After Before > VBA( ) 3-1 3-1 Access Open Load Sub Funtion 3-1-2 Sub Funtion Private Me Me Forms Reports Form Report VisualBasic

More information

2

2 1 2 1-1 Visual Basic 3 1-2 3/8-3/21 3/22-4/4 4/5-4/18 4/19-5/2 5/3-5/16 5/17-5/30 5/31-6/13 6/14-6/27 6/28-7/11 7/12-7/25 7/26-8/8 8/9-8/22 8/25-9/5 9/6-9/19 9/20-10/3 10/4-10/17 10/18-10/31 11/15-11/28

More information

Microsoft PowerPoint - OPVB1基本VB.ppt

Microsoft PowerPoint - OPVB1基本VB.ppt 大 綱 0.VB 能 做 什 麼? CH1 VB 基 本 認 識 1.VB 歷 史 與 版 本 2.VB 環 境 簡 介 3. 即 時 運 算 視 窗 1 0.VB 能 做 什 麼? Visual Basic =>VB=> 程 式 設 計 語 言 => 設 計 程 式 設 計 你 想 要 的 功 能 的 程 式 自 動 化 資 料 庫 計 算 模 擬 遊 戲 網 路 監 控 實 驗 輔 助 自 動

More information

Microsoft Word - 小心翼翼的二十一點N.doc

Microsoft Word - 小心翼翼的二十一點N.doc 投 稿 類 別 : 資 訊 類 篇 名 : 小 心 翼 翼 的 二 十 一 點 作 者 : 陳 鈺 文 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 李 伯 謙 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 胡 家 媛 國 立 瑞 芳 高 級 工 業 職 業 學 校 資 訊 二 指 導 老 師 : 周 曉 玲 老 師 陳 思 亮 主 任 壹 前 言 一 研 究 動 機 平

More information

SMM667.mps

SMM667.mps 第 章 设 计 简 单 程 序 本 章 是 学 习 VB 程 序 设 计 的 入 门 篇, 其 中 涉 及 的 几 个 常 用 控 件 和 基 本 语 句 是 后 续 章 节 中 反 复 使 用 的 基 础 内 容 学 习 目 标 瞯 了 解 顺 序 程 序 结 构 瞯 熟 悉 用 户 界 面 的 设 计 和 简 单 代 码 设 计 瞯 掌 握 赋 值 语 句 和 InputBox MsgBox Print

More information

untitled

untitled Visual Basic 2005 (VB.net 2.0) [email protected] 立 六 數 串 數數 數 數 串 數 串 數 Len( 串 ) 串 度 Len( 123 )=3 LCase( 串 ) 串 LCase( AnB123 ) anb123 UCase( 串 ) 串 UCase( AnB123 ) ANB123 串 數 InStr([ ], 串 1, 串 2[,

More information

2009年3月二级VB语言笔试真题

2009年3月二级VB语言笔试真题 2008 年 9 月 计 算 机 二 级 VB 语 言 真 题 一 选 择 题 ( 每 题 2 分, 共 计 70 分 ) 1. 一 个 栈 的 初 始 状 态 为 空 现 将 元 素 1 2 3 4 5 A B C D E 依 次 入 栈, 然 后 再 依 次 出 栈, 则 元 素 出 栈 的 顺 序 是 A)12345ABCDE B)EDCBA54321 C)ABCDE12345 D)54321EDCBA

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

untitled

untitled 說 參 例 邏 邏 1. 說 2. 數 數 3. 8 4. 理念 李 龍老 立 1. 理 料 2. 理 料 3. 數 料 4. 流 邏 念 5. 良 6. 讀 行 行 7. 行 例 來 邏 1. 說 說 識 量 2. 說 理 類 3. 數 數 念 4. 令 5. 良 6. 流 邏 念 7. 說 邏 理 力 1. 2. 3. 4. 5. 列 念 1 參 1. ( Visual Basic 例 ) (1)

More information

untitled

untitled Visual Basic Visual Basic 7 Visual Basic Visual Basic CIP Visual Basic/. 2003 ISBN 7-302-07899-8... BASIC. TP312 44 CIP 2003 124777 http://www.tup.com.cn 100084 010-62770175 010-62776969 185 260 24.25

More information

( CIP).:,3.7 ISBN TB CIP (3) ( ) ISBN O78 : 3.

( CIP).:,3.7 ISBN TB CIP (3) ( ) ISBN O78 : 3. ( CIP).:,3.7 ISBN 7 568 383 3.......... TB CIP (3) 334 3 37 ( ) 64536 www.hdlgpress.com.c 7879 6 9.75 479 3 7 3 7 45 ISBN 7 568 383 3O78 : 3. 995,.,.,.,. :,,,,.. :,,,,,,.,,,,.,,. ,,.,,,.,,,.,,,,.,.,,,

More information

( ) Wuhan University

( ) Wuhan University Email: huangzh@whueducn, 47 Wuhan Univesity i L A TEX,, : http://affwhueducn/huangzh/ 8 4 49 7 ii : : 4 ; 8 a b c ; a b c 4 4 8 a b c b c a ; c a b x y x + y y x + y x x + y x y 4 + + 8 8 4 4 + 8 + 6 4

More information

列 出 所 有 的 非 負 整 數 解, 係 數 越 大 者 越 先 決 定, 故 先 決 定 z, 再 決 定 y, 最 後 決 定 x, 故 有 + 6 + = 8 ( 種 ) x 0 0 6 8 0 0 6 8 0 6 8 0 y 0 5 0 0 9 8 7 6 5 0 z 0 0 0 0 0

列 出 所 有 的 非 負 整 數 解, 係 數 越 大 者 越 先 決 定, 故 先 決 定 z, 再 決 定 y, 最 後 決 定 x, 故 有 + 6 + = 8 ( 種 ) x 0 0 6 8 0 0 6 8 0 6 8 0 y 0 5 0 0 9 8 7 6 5 0 z 0 0 0 0 0 - 乘 法 原 理 基 礎 型. 從 甲 地 至 乙 地 有 5 條 路 可 走, 由 乙 地 至 丙 地 有 條 路 可 走, 由 丙 地 至 丁 地 有 條 路 可 走, 試 問 從 甲 地 經 乙 丙 兩 地 至 丁 地 的 走 法 有 幾 種? 答 60 解 由 乘 法 原 理 知, 有 5 = 60 ( 種 ). 書 店 的 書 架 上 有 種 不 同 的 英 文 書 和 5 種 不 同

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: [email protected] 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

Microsoft PowerPoint - Chapter5

Microsoft PowerPoint - Chapter5 CH5 表 單 與 控 制 項 課 程 目 標 : 暸 解 VBA 語 言 中 的 控 制 項 及 常 用 屬 性 表 單 在 視 窗 環 境 中, 使 用 者 所 使 用 的 對 話 窗, 精 靈 等 都 是 以 表 單 為 基 本 單 位, 再 加 上 其 它 控 制 項 所 構 成 的 操 作 環 境 利 用 插 入 表 單 為 指 定 的 專 案 插 入 一 個 自 訂 表 單 表 單 常

More information

6. 4 5 6 7 8 9 10 11 ...1... 1...1...1...2... 3...3...5...9... 11...11...11...12...12... 13...13...14... 16...16...19...20 I 1 ---------------------------------------------------3 2 ------------------------------------------------6

More information

Ps22Pdf

Ps22Pdf Visua l Ba sic 6 ( ) 158,,,, Windows ;,, A 6, ; B,, Visual Basic, W indows 95/ 98,, : Visual Basic 6 : : (, 100084) : : : 787 1092 1/ 16 : 23. 75 : 578 : 2002 1 1 2002 1 1 : 0001 5000 : ISBN 7 302 05015

More information

2007年4月全国计算机二级考试VB语言笔试真题

2007年4月全国计算机二级考试VB语言笔试真题 2007 年 4 月 全 国 计 算 机 二 级 考 试 VB 语 言 笔 试 真 题 一 选 择 题 ( 每 题 2 分, 共 计 70 分 ) 1) 下 列 叙 述 中 正 确 的 是 () A) 算 法 的 效 率 只 与 问 题 的 规 模 有 关, 而 与 数 据 的 存 储 结 构 无 关 B) 算 法 的 时 间 复 杂 度 是 指 执 行 算 法 所 需 要 的 计 算 工 作 量

More information

C/C++ - 函数

C/C++ - 函数 C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU [email protected] This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

Visual Basic D 3D

Visual Basic D 3D Visual Basic 2008 2D 3D 6-1 6-1 - 6-2 - 06 6-2 STEP 1 5-2 (1) STEP 2 5-3 (2) - 6-3 - Visual Basic 2008 2D 3D STEP 3 User1 6-4 (3) STEP 4 User1 6-5 (4) - 6-4 - 06 STEP 5 6-6 (5) 6-3 6-3-1 (LoginForm) PictureBox1

More information

Ps22Pdf

Ps22Pdf ) ,,, :,,,,,,, ( CIP) /. :, 2001. 9 ISBN 7-5624-2368-7.......... TU311 CIP ( 2001) 061075 ( ) : : : : * : : 174 ( A ) : 400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / / www. cqup.

More information

Microsoft Word - 專題製作研究報告書.doc

Microsoft Word - 專題製作研究報告書.doc 大 富 翁 之 我 要 畢 業 指 導 老 師 : 王 啟 修 參 賽 學 生 : 吳 皇 逸 林 晉 逸 黃 亭 瑋 賴 建 豫 嘉 義 高 商 資 料 處 理 科 摘 要 本 專 題 以 大 富 翁 遊 戲 為 基 本 題 材, 並 參 考 任 天 堂 遊 戲 公 司 製 作 的 Mario Party 電 視 遊 戲 和 各 代 的 大 富 翁, 將 不 同 風 格 的 小 遊 戲 與 傳 統

More information

<4D6963726F736F667420576F7264202D20C1E3B5E3CFC2D4D8C4A3B0E52E646F63>

<4D6963726F736F667420576F7264202D20C1E3B5E3CFC2D4D8C4A3B0E52E646F63> 历 年 MBA MPAcc 联 考 数 学 真 题 及 答 案 详 解 (009-0) 009 年 月 MBA 联 考 数 学 真 题 及 答 案 详 解 一 问 题 求 解 ( 本 大 题 共 小 题, 每 小 题 分, 共 分 下 列 每 题 给 出 的 五 个 选 项 中, 只 有 一 项 是 符 合 试 题 要 求 的 请 在 答 题 卡... 上 将 所 有 选 项 的 字 母 涂 黑 ).

More information

VB控件教程大全

VB控件教程大全 Datagrid DataGrid1.Columns.Remove(0) ' 0 DataGrid1.Columns.Add(0).Caption= ' DataGrod1.Columns(0).DataField= Name ' Adodc1.Refresh DataGrid BackColor Font DataGrid CellPadding HTML CellSpacing HTML Width

More information

勤 學 * 卓 越 * 快 樂 成 長 本 校 在 老 師 群 策 群 力 共 同 討 論 下, 型 塑 了 學 校 願 景 : 勤 學 卓 越 快 樂 成 長 ( 一 ) 勤 學 運 用 真 的 力 量 培 養 勤 學, 以 語 文 教 為 基 礎 紮 根 ( 二 ) 卓 越 利 用 美 的 感

勤 學 * 卓 越 * 快 樂 成 長 本 校 在 老 師 群 策 群 力 共 同 討 論 下, 型 塑 了 學 校 願 景 : 勤 學 卓 越 快 樂 成 長 ( 一 ) 勤 學 運 用 真 的 力 量 培 養 勤 學, 以 語 文 教 為 基 礎 紮 根 ( 二 ) 卓 越 利 用 美 的 感 桃 園 市 復 旦 國 民 小 學 104 學 年 度 學 校 課 程 計 畫 壹 依 據 貳 目 的 一 教 基 本 法 第 13 條, 國 民 教 法 第 4 條 二 教 部 92 公 佈 之 國 民 中 小 學 九 年 一 貫 課 程 綱 要 三 桃 園 市 政 府 推 動 國 民 中 小 學 九 年 一 貫 課 程 實 施 計 畫 四 桃 園 市 政 府 97.5.29 府 教 數 字 第

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

untitled

untitled MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12

More information

IsPostBack 2

IsPostBack 2 5 IsPostBack 2 TextBox 3 TextBox TextBox 4 TextBox TextBox 1 2 5 TextBox Columns MaxLength ReadOnly Rows Text TextMode TextMode MultiLine TextMode MultiLine True False TextMode MultiLine Password MulitLine

More information

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc TwinCAT 2001.12.11 TwinCAT 1. TwinCAT... 3 2.... 4... 4...11 3. TwinCAT PLC... 13... 13 PLC IEC 61131-3... 14 4. TwinCAT... 17... 17 5. TwinCAT... 18... 18 6.... 19 Maschine.pro... 19... 27 7.... 31...

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

C/C++语言 - 运算符、表达式和语句

C/C++语言 - 运算符、表达式和语句 C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe

More information

基于UML建模的管理管理信息系统项目案例导航——VB篇

基于UML建模的管理管理信息系统项目案例导航——VB篇 PowerBuilder 8.0 PowerBuilder 8.0 12 PowerBuilder 8.0 PowerScript PowerBuilder CIP PowerBuilder 8.0 /. 2004 21 ISBN 7-03-014600-X.P.. -,PowerBuilder 8.0 - -.TP311.56 CIP 2004 117494 / / 16 100717 http://www.sciencep.com

More information

E. (A) (B) (C) (D). () () () (A) (B) (C) (D) (E). () () () (A) (B) (C) (D) (E). (A)(B)(C) (D) (E) (A) (B) (C) (D) (E) (A) (B)(C) (D) (E). (A) (B) (C)

E. (A) (B) (C) (D). () () () (A) (B) (C) (D) (E). () () () (A) (B) (C) (D) (E). (A)(B)(C) (D) (E) (A) (B) (C) (D) (E) (A) (B)(C) (D) (E). (A) (B) (C) . (A) (B) (C) (D) (A) (B) (C)(D)(E). (A) (B) (C) (D) (E) (A) (B) (C) (D). (A) (B) (C) (D) (E) (A) (B) (C) (D) (E). (A) (B) (C) (D) (E). (A) (B) (C) (D) (E). (A) (B) (C) (D) (E) (A) (B) (C) (D) (E). (A)

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

6CO2 6H 2O C6H 2O6 6O2 = = n i= P X i n H X - P X logp X i= i n X X X P i P 0 i l n i n n P i= i H X = - p log P n i= i i i + H X - P X logp X dx - 2 2 2 2 3 2 4 2 d( Q) d( Q) > 0 = 0 di di d(

More information

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f 27 1 Vol.27 No.1 CEMENTED CARBIDE 2010 2 Feb.2010!"!!!!"!!!!"!" doi:10.3969/j.issn.1003-7292.2010.01.011 OPC 1 1 2 1 (1., 412008; 2., 518052), OPC, WinCC VB,,, OPC ; ;VB ;WinCC Application of OPC Technology

More information

untitled

untitled 1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form

More information

Ps22Pdf

Ps22Pdf 2001 ( ) 063,, ( CIP ) : : : (100054, 8 ) : : (021) 73094, ( 010 )63223094 : : : 850 1168 1/ 32 : : : : 2001 2001 : : ISBN 7-113 - 04319-4/ U 1192 : 24 00,, : ( 021 ) 73169, ( 010) 63545969 : : : : : :

More information

: : : ( CIP ) : ( ) /. :, ISBN :. G7. 4 CIP ( 00 ) 005 : : ( ) : : ( 0 : 0004) : : : / 6 : 7 ( ) : 408 () : 00

: : : ( CIP ) : ( ) /. :, ISBN :. G7. 4 CIP ( 00 ) 005 : : ( ) : : ( 0 : 0004) : : : / 6 : 7 ( ) : 408 () : 00 () ( ) ( : ) : : : ( CIP ) : ( ) /. :, 00. 7 ISBN 7-8008 - 958-8... :. G7. 4 CIP ( 00 ) 005 : : ( ) : : ( 0 : 0004) : : 00 7 00 7 : 78709 / 6 : 7 ( ) : 408 () : 000 : ISBN 7-8008 - 958-8/ G89 : 9 98. 00

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

Microsoft Word - 102119003.htm

Microsoft Word - 102119003.htm 102 年 度 11900 電 腦 軟 體 設 計 丙 級 技 術 士 技 能 檢 定 學 科 測 試 試 題 本 試 卷 有 選 擇 題 80 題, 每 題 1.25 分, 皆 為 單 選 選 擇 題, 測 試 時 間 為 100 分 鐘, 請 在 答 案 卡 上 作 答, 答 錯 不 倒 扣 ; 未 作 答 者, 不 予 計 分 准 考 證 號 碼 : 姓 名 : 選 擇 題 : 1. (4)

More information

<4D6963726F736F667420576F7264202D20B3CCD0F2D4B12DC9CFCEE7CCE2A3AD3037C9CF>

<4D6963726F736F667420576F7264202D20B3CCD0F2D4B12DC9CFCEE7CCE2A3AD3037C9CF> 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2007 年 上 半 年 程 序 员 上 午 试 卷 ( 考 试 时 间 9 : 00~11 : 30 共 150 分 钟 ) 请 按 下 述 要 求 正 确 填 写 答 题 卡 1. 在 答 题 卡 的 指 定 位 置 上 正 确 写 入 你 的 姓 名 和 准 考 证 号, 并 用 正 规 2B 铅 笔 在

More information

b1²Ä¤@³¹¼Æ»P§¤¼Ð¨t

b1²Ä¤@³¹¼Æ»P§¤¼Ð¨t 第 一 章 數 與 坐 標 系 大 學 聯 考 試 題 與 推 薦 甄 選 試 題 第 一 類 大 學 入 學 甄 試 試 題 評 量 1. 下 列 何 者 是 2 100 除 以 10 的 餘 數? (1) 0 (2) 2 (3) 4 (4) 6 (5) 8 88 年 2. 一 個 正 三 角 形 的 面 積 為 36, 今 截 去 三 個 角 ( 如 右 圖 ), 使 成 為 正 六 邊 形,

More information

Ps22Pdf

Ps22Pdf f e L/ b I I P AD c b b P 131 132 133 b 134 W b b W 135 e d b AB b F F f f E E E E E G G G G G G E G E A B C D ABCD A B A B C D AB AB ABC D A BD C A B C D D D D E E E D b ED ED b ED b G E b b b b b

More information

多層次傳銷與獎金系統

多層次傳銷與獎金系統 醒 吾 技 術 學 院 資 訊 管 理 系 ( 五 專 部 ) 九 十 六 學 年 度 畢 業 專 題 多 層 次 傳 銷 與 獎 金 系 統 組 員 : 921506122 游 濬 瑋 921506126 陳 彥 宇 921506139 林 龍 華 921506144 陳 昶 志 921506149 楊 璧 如 指 導 老 師 : 汪 淵 老 師 中 華 民 國 九 十 七 年 一 月 十 一 醒

More information

数 学 高 分 的 展 望 一 管 理 类 联 考 分 析 第 一 篇 大 纲 解 析 篇 编 写 : 孙 华 明 1 综 合 能 力 考 试 时 间 :014 年 1 月 4 日 上 午 8:30~11:30 分 值 分 配 : 数 学 :75 分 逻 辑 :60 分 作 文 :65 分 ; 总

数 学 高 分 的 展 望 一 管 理 类 联 考 分 析 第 一 篇 大 纲 解 析 篇 编 写 : 孙 华 明 1 综 合 能 力 考 试 时 间 :014 年 1 月 4 日 上 午 8:30~11:30 分 值 分 配 : 数 学 :75 分 逻 辑 :60 分 作 文 :65 分 ; 总 目 录 数 学 高 分 的 展 望... 1 第 一 篇 大 纲 解 析 篇... 1 一 管 理 类 联 考 分 析... 1 二 最 新 大 纲 解 析... 1 三 考 前 复 习 资 料 及 方 法... 第 二 篇 总 结 篇... 4 1 应 用 题 考 点 总 结 与 技 巧 归 纳... 4 代 数 模 块 题 型 归 纳 及 考 点 总 结... 9 3 数 列 模 块 题 型 归

More information

Microsoft PowerPoint - VB14.ppt

Microsoft PowerPoint - VB14.ppt VB 列表盒 LISTBOX 應用 資科系 林偉川 執行畫面 1 2 1 重要屬性 LISTBOX 物件 (VB6) 新增至 LISTBOX 物件中 ADDITEM 自 LISTBOX 物件中刪除選取物件 REMOVEITEM 自 LISTBOX 物件中取出選取物件 ListIndex 顯示 LISTBOX 物件中紀錄個數 Listcount 3 LISTBOX 物件 (VB.NET) 重要屬性 新增至

More information

3. 給 定 一 整 數 陣 列 a[0] a[1] a[99] 且 a[k]=3k+1, 以 value=100 呼 叫 以 下 兩 函 式, 假 設 函 式 f1 及 f2 之 while 迴 圈 主 體 分 別 執 行 n1 與 n2 次 (i.e, 計 算 if 敘 述 執 行 次 數, 不

3. 給 定 一 整 數 陣 列 a[0] a[1] a[99] 且 a[k]=3k+1, 以 value=100 呼 叫 以 下 兩 函 式, 假 設 函 式 f1 及 f2 之 while 迴 圈 主 體 分 別 執 行 n1 與 n2 次 (i.e, 計 算 if 敘 述 執 行 次 數, 不 1. 右 側 程 式 正 確 的 輸 出 應 該 如 下 : * *** ***** ******* ********* 在 不 修 改 右 側 程 式 之 第 4 行 及 第 7 行 程 式 碼 的 前 提 下, 最 少 需 修 改 幾 行 程 式 碼 以 得 到 正 確 輸 出? (A) 1 (B) 2 (C) 3 (D) 4 1 int k = 4; 2 int m = 1; 3 for (int

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023) ( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.

More information

吳元康

吳元康 逢 甲 大 學 自 動 控 制 工 程 學 系 專 題 製 作 專 題 論 文 精 密 雙 軸 平 台 之 微 動 控 制 設 計 The Design of Micromovement Control of the Precision X-Y Stage 指 導 教 授 : 張 興 政 學 生 : 鄭 慶 朗 中 華 民 國 九 十 三 年 六 月 逢 甲 大 學 自 動 控 制 工 程 學 系

More information

996,,,,,,, 997 7, 40 ; 998 4,,, 6, 8, 3, 5, ( ),, 3,,, ;, ;,,,,,,,,,

996,,,,,,, 997 7, 40 ; 998 4,,, 6, 8, 3, 5, ( ),, 3,,, ;, ;,,,,,,,,, ,, AB,, ( CIP) /, 000 ( /, ) ISBN 704009448 F47 CIP ( 000) 86786 55 00009 0064054588 ht tp www hep edu cn ht tp www hep com cn 006404048 787960/ 6 05 370 000 730,, 996,,,,,,, 997 7, 40 ; 998 4,,, 6, 8,

More information

B4C2

B4C2 - ( )( ) B=A A A k A A A k (B)=(A )+(A )+ +(A k ) (B) B A A A k B (Patitios) Ex. 6 4 As. ()(A )=(U) (A) ()(A B )=((A B) )=(U) (A B) (DeMoga). (A-B)=(A) (A B) Ex. A={x x N x 0 6 } B={x x=0k k Z} (A B)=

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

untitled

untitled 21 Visual FoxPro Visual FoxPro 6.0 11 Visual FoxPro Visual FoxPro CIP Visual FoxPro 2004 21 ISBN 7-03-014834-7 V Visual FoxPro TP311.138 CIP 2004 143035 16 100717 http://www.sciencep.com * 2004 12 7871092

More information

68003 (Project Unity TC)_.indb

68003 (Project Unity TC)_.indb 2014 8 31 2016 2 6 104 2015 4 24 105 2008 6 1 2014 7 29 2 5,000 1 106 5 2008 3 5% 5% 2012 10 11 5% 5% 20% 25% H 17.51% A 107 A0.07% A 0.06% A H 25% H 25% 30 10 2015 8 27 5% 108 5% 2008 12 1 5% 2012 9 23

More information

untitled

untitled Visual Basic 6.0 Visual Basic 6.0 /. 2001.8 ISBN 7-115-10518-9 I. V II. III. BASIC IV. TP312 CIP (2002) 055959 Visual Basic Microsoft 14 1~6 Visual Basic 7~14 Internet Windows API ActiveX Visual Basic

More information

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666

More information

<4D F736F F D DA5BFA6A1C476C1C92DBEC7ACECB8D5A8F728B57BB35D292E646F63>

<4D F736F F D DA5BFA6A1C476C1C92DBEC7ACECB8D5A8F728B57BB35D292E646F63> 全國高級中等學校 106 學年度商業類科學生技藝競賽 程式設計 職種 學科 試卷 選手證號碼 ( 崗位編號 ): 姓名 : 注意事項 : 請將答案劃記於答案卡, 未依規定劃記者不予計分 試題說明 :( 選擇題共 25 題每題 4 分, 答錯不倒扣, 共 100 分 ) ( )1. 執行以下 Visual Basic 程式片段, 其結果為何?(A) 15 (B) 12 (C) 7 (D) 3 Dim

More information

Ps22Pdf

Ps22Pdf ( ) 158,,,,,, ( CIP) /. :, 1996. 12 ISBN 7 302 02353 0... :. F275 CIP ( 96) 20860 : ( :, 100084) : : : 850 1168 1/ 32 : 13. 25 : 344 : 1996 12 1 1996 12 1 : ISBN 7 302 02353 0/ F 130 : 0001 5000 : 16.

More information

單元5

單元5 13-1 13-2 / 13-3 14-1 Visual Basic 14-2 14-3 15-1 15-2 15-3 287 290 307 13-1 13-1.1 272 Introduction to Computer Science 13-1.1 1. 2. 3. 4. 273 274 Introduction to Computer Science 275 13-1.2 13-1.1 /

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information