正在加载图片...
A. Drivel的 Change事件过程中加入Dir1Path= Drive l drive,在Dr1的 Change事件 中加入 Filel Path=Dr1Path代码 B. Drivel I的 Change事件过程中加入 Dir l Path= Dir l Path,在Dr1的 Change事件中加 入 Filel path= Drivel. drive代码 C.Drl的 Change事件过程中加入 Dir l Path= Drive. Drive,在 Drivel的 Change事件 中加入 Filel Path= Filel fileName代码 D.Dr1的 Change事件过程中加入Dr1Path= Drive l Drive,在 Drive的 Change事件 中加入 Filel Path= Dir 1. Path代码 2.程序阅读题 (1)写出程序运行结果 Private Sub Commandl Click() Open"d: Data. txt"For Output As #1 For i=2 to 8 Print #1 Next Open"d: I Data. txt"For Input As #2 k=0 While Not EOF(2) Close #2 Print a(i) (2)执行以下程序后, Prime. dat文件中的内容为 Private Sub Form Click Dim num As Integer, datl As Integer, dat2 As Integer Dim swit As boolean Open"d: \prime. dat"For Output As #1 For datl=2 To 10 rue For dat2=2 To Sar(dat 1) If (datI Mod dat 2 )=0 Then Exit For End lf If swit then uim - num Write#1,"第";num;,"个数";datl End If Next datI End sub 编程题A. Drive1 的 Change 事件过程中加入 Dir1.Path = Drive1.Drive,在 Dir1 的 Change 事件 中加入 File1.Path = Dir1.Path 代码 B. Drive1 的 Change 事件过程中加入 Dir1.Path =Dir1.Path,在 Dir1 的 Change 事件中加 入 File1.Path = Drive1.Drive 代码 C. Dir1 的 Change 事件过程中加入 Dir1.Path = Drive1.Drive,在 Drive1 的 Change 事件 中加入 File1.Path = File1.FileName 代码 D. Dir1 的 Change 事件过程中加入 Dir1.Path = Drive1.Drive,在 Drive1 的 Change 事件 中加入 File1.Path = Dir1.Path 代码 2.程序阅读题 (1)写出程序运行结果 Private Sub Command1_Click( ) Dim a(20)As Integer Open “d:\ Data.txt” For Output As #1 For i = 2 To 8 For j = 1 To i Print #1, j Next j Next i Close #1 Open "d:\ Data.txt" For Input As #2 k = 0 While Not EOF(2) k = k + 1 Input #2, a (k) Wend Close #2 For i = 2 To k / 4 Print a (i) Next I End Sub (2)执行以下程序后,Prime.dat 文件中的内容为 Private Sub Form_Click() Dim num As Integer, dat1 As Integer, dat2 As Integer Dim swit As Boolean Open "d:\prime.dat" For Output As #1 num = 0 For dat1 = 2 To 10 swit = True For dat2 = 2 To Sqr(dat1) If (dat1 Mod dat2) = 0 Then swit = False Exit For End If Next dat2 If swit Then num = num + 1 Write #1, " 第"; num; "个数"; dat1 End If Next dat1 Close #1 End Sub 3.编程题
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有