更多"下面程序运行时,若输入“Visual Basic Programmin"的相关试题:
[单项选择]下面的程序运行时,若输入“Visual Basic Programming”,则在窗体上输出的是
Private Sub Command1_Click( )
Dim count(25) As Integer, ch As String
ch=Uease(InputBox("请输入字母字符串"))
For k=1 To Len(eh)
n=Asc(Mid(ch, k, 1))-Asc("A")
If n>0 Then
Count(n)=Count(n)+1
End If
Next k
m=Count(0)
For k=1 To 25
If m<count(k) Then
m=count(k)
End If
Next k
Print m
End Sub
A. 0
B. 1
C. 2
D. 3
[单项选择]下面程序运行时,单击窗体后,窗体上显示的结果是( )。
Private Sub Form_Click( )
Dim I As Integer
Dim sum As Long
sum=0
For I=10 To 16
If I Mod 3=0 OrI Mod 5=0 Then
sum=sum+I
End If
Next I
Print sum
End Sub
A. 10
B. 12
C. 37
D. 22
[单项选择]执行下列程序段
a$="visual Basic Programming"
b$="C++"
C$=UCase(Left$(a$,7))&b$&Right$(a$,1 2)
后,变量c$的值为( )。
A. Visual BASIC Programming
B. VISUAL C++Programming
C. Visual C++Programming
D. VISUAL BASIC Programming
[单项选择]以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。
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);
[填空题]以下程序在运行时若输入: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