更多"下面的程序运行时,若输入“Visual Basic Programmi"的相关试题:
[单项选择]下面程序运行时,若输入“Visual Basic Programming”,则在窗体上输出的是( )。
Private Sub Command1 Click( )
Dim Num(25)As Integer,Chr1 As String
Chr1=UCase(InputBox("请输入字母字符串"))
For k=1 To Len(Chr1)
n=Asc(Mid(Chr1,k,1))-Asc("A")
If n>=0 Then
Num(n)=Num(n)+1
End If
Next k
m=Num(0)
Fork=1 To 25
If m<Num(k)Then
m=Num(k)
End If
Next k
Print m
End Sub
A. 3
B. 2
C. 1
D. 0
[单项选择]下面程序运行时,单击窗体后,窗体上显示的结果是( )。
Private Sub Form_Click
Dim I As Integer
Dim sum As Long
Dim t1 As Long
t1=1:sum=0
For 1=1 To 3
t1=t1*I
sum=sum+t1
Next I
Print sum
End Sub
A. 3
B. 9
C. 5
D. 6
[单项选择]以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。
Private SubForm_Click( )
Dim a As Integer,b As Integer
a=10 :b=20
Call ff(a,B)
Print a,b
End Sub
Private Sub ff(x As Integer,y As Integer)
x=x+y
y=x+y
End Sub
A. 30 50
B. 30 30
C. 20 20
D. 10 20
[填空题]以下程序在运行时若输入:1234567,则程序的运行结果是______。
#include<stdio.h>
main( )
int x, y;
scanf("%2d%1d", &x, &y); printf("%d/n", x+y);
[单项选择]窗体上有一个名称为Option1的单选按钮数组,程序运行时,当单击某个单选按钮时,会调用下面的事件过程:
Private Sub Option1_Click(Index As Integer)
…
End Sub
下面关于此过程的参数Index的叙述中正确的是( )。
A. Index为1表示单选按钮被选中,为0表示未选中
B. Index的值可正可负
C. Index的值用来区分哪个单选按钮被选中
D. Index表示数组中单选按钮的数量
[填空题]下列程序运行时,若输入123,输入对话框的提示信息是______。
Private Sub Command1_Click( )
X1=InputBox("请输入")
MsgBox(X1)
End Sub
[填空题]下列程序运行时,若输入123,输入对话框的提示信息是______。
Private Sub Command1_Click( )
X1=InputBox("请输入")
MsgBox(X1)
End Sub
[填空题]下列程序运行时,若输入1abcedf2df<回车>,则程序的输出结果为______。
#include <stdio.h>
main( )
char a=0,ch;
while((ch=getchar( ))!=’/n’)
if(a%2!=0&&(ch>=’a’&&ch<=’z’))ch=ch-’a’+’A’;
a++;putchar(ch);
printf("/n");
[填空题]下面程序是由鼠标事件在窗体上画图,如果按下鼠标可以画图,双击窗体则可以清除所画图形。补充完整下面的程序。首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load( )
DrawWidth=2
ForeColor=vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X AS Single,Y AS Single)
PaintStart=True
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If PaintStart Then
PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub
Private Sub Form_DblClick( )
Cls
End Sub
[填空题]下面程序是由鼠标事件在窗体上画图,如果按下鼠标将可以画图,双击窗体可以清除所画图形。补充完整下面的程序。
首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load( )
DrawWidth=2
ForeColor=vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,_
X As Single,Y As Single)
【 】
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,_
X As Single,Y As Single)
If PaintStart Then
PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,_
X As Single,Y As Single)
【 】
End Sub
Private Sub Form_Db1Click( )
【 】
End Sub
[简答题]窗体上已建立多个控件,如Text1、Commandl、Label1,若要使程序开始运行时焦点定位在Commandl控件上,则应将Commandl控件的_____________属性值设置为_____________。
[填空题]在窗体上画一个文本框,名称为Text1,画一个命令按钮,名称为Command1。程序运行时,单击命令按钮,能将事先输入到文本框中的内容一个字符一个字符地写入顺序文件test .dat中。请在空格处填上适当的内容,将程序补充完整。
Private Sub Command1_Click( )
Open "c:/test.dat"For 【14】 As #1
For i=1 to Len(Text1.text)
print#1,mid(Text1.Text,i,1)
Next
Close #i
End Sub