下列程序的功能是;将数据1,2,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。 Private Sub Form_Click() Dim i As Integer Open "Num.txt" For Output As #1 For i=1 To 8 __________ Next i Close #1 End SubA.print #1,iB.input #1,iC.print #1D.input #1

下列程序的功能是;将数据1,2,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。 Private Sub Form_Click() Dim i As Integer Open "Num.txt" For Output As #1 For i=1 To 8 __________ Next i Close #1 End Sub

A.print #1,i

B.input #1,i

C.print #1

D.input #1


相关考题:

列程序的功能是:将数据1,2,…,10写入顺序文件Base.txt中,请填空。Private Sub Form_Click()Dim i As IntegerOpen 【11】 As #1For i=1 To 10【12】Next iClose #1End Sub

下列程序的功能是:将数据1,2,…,8写入顺序文件Num.txt中,请补充完整。Private Sub Form_Click()Dim i As IntegerOpen "Num.txt"For Output As #1For i=1 To 8【15】Next iClose #1End Sub

对窗体编写如下事件过程: Private Sub Form_ MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If Button =2 Then Print “AAAAA” End If End Sub Private Sub Form_ MouseUp (Button As Integer,Shift As Integer,X As Single,Y As Single) Print “BBBBB” End Sub 程序运行后,如果单击鼠标右键,则输出结果为______ 。A.AAAAA BBBBBB.BBBBBC.AAAAAD.BBBBB AAAAA

下列程序的作用是:打开顺序文件C:\stuDatA.txt,读取文件中的数据,并将数据显示在窗体上。该程序不完整,请补充完该程序。Private Sub Form_Click()【 】Do While Not EOF(1)Input 1,StrNo,StuName,StuEngPrint StuNo;Tab(10);StuName;Tab(20);StuEngLoopClose 1End Sub

下列程序的功能是将字符串“abcde”逆序打印出来。请填写空白处以完善程序。 Munction rev(str1)As String B = Mid(,1,1) If B =""Then rev ="" Else rev = rev(Mid(str1,2))+b End If End Function Private Sub Form_Click() old ="abcde" Print rev(old) End Sub

下列程序的功能是:将数据1,2,......,8写入顺序文件Num.txt中,请选择正确的程序段 Private Sub Form_Click() Dim i As Integer Open "Num.txt"For Output As #1 For i=1 To 8 ______ Next i Close #1 End SubA.print#1,i B.input#1,i C.print#1 D.input#1

(34)下列程序的功能是:将数据1,2,…,8写入顺序文件Num.txt中,请选择正确的程序段。 Private Sub For_Click() Dim i As Integer Open "Num.txt"For Output As #1 For i=1 To 8 Next i Close #1 End SubA.Print #1,i B.input #1,I C.Print #1 D.input #1

下列程序段的功能为:单击窗体后,在D盘Temp目录下address.txt 文件中输入“张三,20,Male”。请填空。Private Sub form_ click()Dim name As StringDim age As IntegerDim sex As Stringname = "张三": age = 20: sex = "Male"Open "D:\temp\CodE.txt" For Append As 1______1, name, age, sex______End Sub

下列程序段的功能是,单击命令按钮后,将随机产生10个三位数,并将这些数写到C盘根目录下的datA.txt文件中。请填空。Private Sub Command1_Click()Dim a As IntegerOpen【 】For Output As 100RandomizeFor i =1 To 10a=100+Int(899*RnD) 【 】Next iClose 100End Sub

下列程序的运行机结果是【 】。Private Sub Form_ Click()Dim k As Integern= 5m= 1k= 1Dom=m+2k= k+1Loop While k<=nPrint mEnd Sub

下列程序的功能是:当x100时, Private Sub Command1_ 下列程序的功能是:当x<50时,y =0.8 xx;当50≤x≤100时,y=0.7 xx;当x>100时,Private Sub Command1_Click()Dim x As Singlex = InputBox("请输入x的值" )Select Case xCase Is<50y=0.8 * xCase 50 To 100y=0.7 * x【 】Print "输入数据出界!"End SelectPrint x, yEnd Sub

如下图所示,只执行下列程序后,有Text1.Text=Text1,文本框不能出现“*****”的程序是______。A.Private Sub form_ Load() Text1. Text="*****"End SubB.Private Sub form_ Load() Text1. PasswordChar=“*”End SubC.Private Sub form_ Load() Text1. Visible="*****" End SubD.Private Sub form. Load() Text1. Text= String(5,"*")End Sub

阅读程序:Private Sub Form_ Click() a=0 For j=1 To 15 a=a+j Mod 3 Next j Print aEnd Sub 程序运行后,单击窗体,输出结果是______。A.105B.1C.120D.15

设有以下程序:Private Sub Form_ Click() x=50 For i=1 To 4 y=InputBox(“请输入—个整数”) y=Val(y) If y Mod 5=0 Then a=a+ y x=y Else a=a+ x End If Next i Print aEnd Sub 程序运行后,单击窗体,在输入对话框中依次输入15、24、35、46,输出结果为 ______。A.100B.50C.120D.70

下列程序的功能是把顺序文件smtextl.txt的内容全部读入内存,并在文本框Textl中显示出来。请填空。Private Sub Command1_Click()Dim inData As StringText1.Text=""Open "smtext1.txt"【 】As【 】Do While【 】Input 2,inDataText1.Text=Text1.Text inDataLoopClose 2End Sub

在窗体上画一个文本框,名称为Textl,然后编写如下程序:Private Sub Form_Load()Open”d:\temp\dat.txt”For Output As1Textl.Text=“”End SubPrivate Sub Textl KeyPress(KeyAscii As Integer)IfKeyAscii=13 ThenIf UCase(Textl.Text)=【 】ThenClose1EndElseWrite1,【 】Textl.Text=…End IfEnd IfEnd SUb以上程序的功能是:在D盘temp文件夹下建立一个名为dat.txt的文件,在文本框中输入字符,每次按回车键都把当前文本框中的内容写入文件dat.txt,并清除文本框中的内容;如果输入“END”,则不写入文件,直接结束程序。请填空。

以下程序需要实现的功能是:在C盘根目录下建立一个名为Students.txt的顺序文件。单击命令按钮后,输入4个学生的个人信息,包括name、sex和age,将这些信息写入文件中。请填空。Private Sub Form_Click()Open【 】For Output As 1For i=1 To 4name=InputBox("姓名")age=InputBox("年龄")sex=InputBox("性别")Write【 】Next iClose 1End Sub

以下程序运行后的输出结果是______。 Private Sub Form_ Click() y=1 :x=2 Print Iif(x>=y,x,y) End SubA.0B.1C.2D.3

下列程序的功能是单击窗体时在消息框中输出1000以内能同时被3、5和7整除的整数,请补充完整此程序:Private Sub Form_Click()sum=0For i=1 To 1000If______Thensum=sum+IEnd IfNext IMsgBox sumEnd Sub

下面一段程序的功能是,单击窗体弹出对话框。在对话框中输入一个文件名,窗体中输出该文件名的文件号。请填空。Private Sub Form_ click()filename = InputSox (“请输入文件名”)Filecode =Open filename For Output As FilecodePrint filename; “的文件号是”; FilecodeClose FilecodeEnd Sub

下列程序的功能是:将数据1,1,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。Private Sub Form_Click()Dim i As IntegerOpen"Num.txt"For Output As #1For i=1 To 8______Next iClose #1End SubA.print#1,iB.input#1,IC.print#1D.input#1

下列程序的功能是:将数据1,2,…,8写入顺序文件Num.txt中,请选择正确的程序段( )。 Private Sub Form_Click() Dim i As Integer Open "Num.txt" For Output As #1 For i=1 To 8 ______ Next i Close #1 End SubA.print #1,iB.input #1,iC.print #1D.input #1

下面程序段的作用:在窗体上一个命令按钮。单击命令按钮后,将程序中字符串 "Welcome Home"中的字符全部大写输出,其后字符"Wel Back"全部小写输出。请填空。Private Sub Command1_Click()a = "Welcome Home";b = "Wel Back"c = 【 】+ LCase(B) Print cEnd Sub

下面程序执行的结果是______。 Private Sub Form_ Click() A$=“123”:B$=“456” C=Val(A$)+Val(B$) Print C\100 End SubA. 123B.3C.5D.579

假定已经在菜单编辑器中建立了窗体的弹出式菜单,其顶级菜单的名称为a1,其“可见”属性为False,则程序运行后,可以同时响应鼠标左键单击和右键单击的事件过程是 ______。A.Private Sub Form_ MouseDown (Button As Integer, _ Shift As Integer, X As Single, Y As SinglE)If Button = 1 And Button = 2 Then PopupMenu al End If End SubB.Private Sub Form_ MouseDown (Button As Integer, _ Shift As Integer, X As Single, Y As SinglE)PopupMenu a1 End SubC.Private Sub Form_ MouseDown (Button As Integer, _ Shift As Integer, X As Single, Y As SinglE)If Button = 1 Then PopupMenu a 1 End If End SubD.Private Sub Form_ MouseDown(Button As Integer, _ Shift As Integer, X As Single, Y As SinglE)If Button = 2 Then PopupMenu a 1 End If End Sub

下列程序的功能是:当x100时,没有意义。请填空。 Private 下列程序的功能是:当x<50时,y=0.8×x;当50≤x≤100时,y=0.7×x;当x>100时,没有意义。请填空。Private Sub Command1_Click()Dim x AS Singlex=InputBox("请输入x的值!")________Case Is<50y=0.8*xCase 50 To 100y=0.7*K__________Print"输入的数据出界!"End SelectPrint x,yEnd Sub

设有如下程序; Private Sub Form_ Load() Show Text1.Text = " " Text1.SetFocus End Sub Private Sub Form_ MouseUp (Button As Integer, Shift As Integer, X As Single, Y As SinglE)Print “程序设计” End Sub Private Sub Text1_ KeyDown (KeyCode As Integer, Shift As Integer) Print "Visual Basic" End Sub程序运行后,如果在文本框中输入字母a(即直接按a键),然后单击窗体,则在窗体上显示的内容是______。A.Visual BasicB.程序设计C.Visual Basic程序设计D.A程序设计

在窗体上画一个名为Command1的命令按钮和一个名为Text1的文本框,并把窗体的 KeyPreview 属性设置为True,然后编写如下代码: Dim SaveAll As String Private Sub Form_ Load () Show Text1.Text = " " TextSetFocus End Sub Private Sub Command1 Click() TextText= LCase(SaveAll) End Sub Private Sub Form_ KeyPress (KeyAscii As Integer) SaveAll = SaveAll + Chr(KeyAscii) End Sub程序运行后,在键盘上输入ABCDEFG,单击命令按钮,则文本框中显示的内容为 ______。A.abodefgB.不显示任何信息C.ABCDEFGD.出错