单项选择题有如下Sub过程: Sub Sun(x As Single, y As Single) t=x x=t y y=t Mod y End Sub 在窗体上的命令按钮Command1中,编写如下事件过程,执行该事件过程调用Sun过程,结果为( )。 Private Sub Command1_Click() Dim a As Single Dim b As Single a=5 b=4 Sun a, b Print a; b End Sub
单项选择题在窗体上画1个名为Text1的文本框和1个名为Label1的标签,再画4个名为Op1的单选按钮控件数组,其Index属性按季度顺序为0~3,如图1所示。在文件Sales.txt中按月份顺序存有某企业某年12个月的销售额。要求在程序执行时,鼠标单击一个单选按钮,则Text1中显示相应季度的销售总额,并把相应的文字显示在标签上。如图2所示是单击“第二季度”单选按钮所产生的结果。请选择可在空白处填写的合适语句( )。 Option Base 1 Dim sales(12) As Long Private Sub Form_Load() Open c: sales.txt For Input As #1 Fork= 1 To 12 Input #1, sales(k) Next k Close #1 End Sub Private Sub ______ (Index As Integer) Dim sum As Long, k As Integer, month As Integer sum=0 month=Index* Fork=1 To 3 month=month+1 sum=sum+sales(month) Next k Label1. Caption=______.Caption & 销售总额: Text 1=sum End Sub