更多"工程文件中包含一个模块文件和一个窗体文件。模块文件的程序代码是: P"的相关试题:
[单项选择]设工程文件包含两个窗体文件Form1. frm、Form2. frm及一个标准模块文件Module1. bas。两个窗体上分别只有一个名称为Command1的命令按钮。
Form1的代码如下:
Public x As Integer
Private Sub Form_Load( )
x=1
y=5
End Sub
Private Sub Command1_Click( )
Form2. Show
End Sub
Private Sub Command1_Cliek( )
Print Form1. x, y
End Sub
Module1的代码如下:
Public y As Integer
运行以上程序,单击Form1的命令按钮Command1,则显示Form2;再单击Form2上的命令按钮Command1,则窗体上显示的是( )。
A. 1 5
B. 0 5
C. 0 0 D) 程序有错
[单项选择]
设工程文件包含两个窗体文件Forml.frm、Form2.frm及一个标准模块文件Modulel.bas。两个窗体上分别只有一个名称为Command1的命令按钮。
Forml的代码如下:
Public x As Integer
Privme Sub Form_Load( )
x=1
y=5
End Sub
Private Sub Command1_Click( )
Form2.Show
End Sub
Form2的代码如下:
Private Sub Command1_Click( )
Print Form1.x,y
End Sub
Modulel的代码如下:
Public y As Integer
运行以上程序,单击Form1的命令按钮Command1,则显示Form2;再单击Form2上的命令按钮Command1,则窗体上显示的是()。
A. 1 5
B. 0 5
C. 0 0
D. 程序有错
[单项选择]
设工程文件包含两个窗体文件Form1.frm、Form2.frm及一个标准模块文件Module1.bas。两个窗体上分别只有一个名称为Command1的命令按钮。
Form1的代码如下:
Public x As Integer
Private Sub Form_Load( )
x=1
y=5
End Sub
Private Sub Command1_Chck( )
Form2.Show
End Sub
Form2的代码如下:
Private Sub Command1_Click( )
Print Form1.x,y
End Sub
Module1的代码如下:
Public y As Integer
运行以上程序,单击Form1的命令按钮Command1,则显示Form2;再单击Form2上的命令按钮Command1,则窗体上显示的是()。
A. 1 5
B. 0 5
C. 0 0
D. 程序有错
[单项选择]单击命名按钮时,下列程序代码的执行结果为 Public Sub procl ( n As Integer, Byval m As Integer) n=n Mod 10 m=m Mod 10 End Sub Private Sub Cmmand1 Click( ) Dim x As Integer, y As Integer x=12:y=12 Call Procl (x, y) Print x;y End Sub
A. 12 2
B. 2 12
C. 2 2
D. 12 12
[单项选择]单击命令按钮时,下列程序代码的执行结果为
Public Sub proc1(n As Integer,Byva1 m As Integer)
n=n Mod 10
m=m Mod 10
End Sub
Private Sub Cmmand1_Click( )
Dim x As Integer,y As lngeger
x=12:y=12
Call Proe1(x,y)
Print x;y
End Sub
A. 12 2
B. 2 12
C. 2 2
D. 12 12
[单项选择]标准模块中有如下程序代码:
Public x As Integer,Y As Integer
Sub TempSub( )
x=10:y=20
End Sub
在窗体上有1个命令按钮,并有如下事件过程:
Private Sub Command1 Click( )
Dim x As Integer
Call TempSub
x=x+100:y=y+100
Print x;y
End Sub
运行程序后单击命令按钮,窗体上显示的是( )。
A. 110 100
B. 100 100
C. 100 120
D. 110 120
[单项选择]标准模块中有如下程序代码: Public x As Integer,y As Integer Sub var_pub( ) x=10:y=20 End Sub 在窗体上有1个命令按钮,并有如下事件过程: Private Sub Command1_Click( ) Dim x As Integer Call var_pub x=x+100 y=y+100 Print x;y End Sub 运行程序后单击命令按钮,窗体上显示的是()
A. 100 100
B. 100 120
C. 110 100
D. 110 120
[单项选择]设在工程中有一个标准模块,其中定义了如下类型:
Type stutype
ino As Integer
strname As String*20
strsex As String*1
smark As Single
End Type
在窗体上画一个名为Connnand1的命令按钮,要求当执行事件过程Command1_Click时,在c:/的随机文件student..dat写入一条记录。下列能够完成该操作的事件过程是( )。
A. Sub Command1_C1ick()
B. Sub Command1_Click( )
C. Sub Command1_Click()
D. Sub Command1_Click()
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsExcepfion{
static void Proc(int se1)
throws ArithmeticException,ArraylndexOutOfBoundsException {
System.out.println("in Situation"+se1);
if(se1==0){
System.out.println("no Exception caught");
return;
}else if(se1==1){
int iArray[]=new int[4];
iArray [1]=3;
}
}
public static void main(String args[])[
try{
Proc(0);
Proc(1);
} catch(ArraylndexOutOfBoundsException e) {
System.out.println("Catch"+e);
}finally{
System.out.println("in Proc finally");
}
}
}
执行结果:
In Situation( )
no ExcepbOn cauSht
【14】
in Proc findly
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsExcepfion
static void Proc(int se1)
throws ArithmeticException,ArraylndexOutOfBoundsException
System.out.println("in Situation"+se1);
if(se1==0)
System.out.println("no Exception caught");
return;
else if(se1==1)
int iArray[]=new int[4];
iArray [1]=3;
public static void main(String args[])[
try
Proc(0);
Proc(1);
catch(ArraylndexOutOfBoundsException e)
System.out.println("Catch"+e);
finally
System.out.println("in Proc finally");
执行结果:
In Situation( )
no ExcepbOn cauSht
【14】
in Proc findly
[填空题]请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsException
static void Proc(int sel)
throws ArithmeticException,ArrayIndexOutOfBoundsException
System.out.println("In Situation"+sel);
if(sel==0)
System.out.println(’no Exception caught");
return;
else if(sel==1)
int iArray[]=new int[4];
iArray[1]=3;
public static void main(String args[])
try
Proc(0);
Proc(1);
catch(ArrayIndexOutOfBoundsException e)
System.out.println("Catch"+e);
finally
System.out.println("in Proc finally");
执行结果:
In Situation 0
no Exception caught
【14】
in Proc finally