首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

假定有以下函数过程:Function Fun(S AsString)AsStringDim s1 As StringFor i=1 To Len(S)s1 = U

假定有以下函数过程: Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1 = UCase(Mid(S, i, 1)) +s1 Next i Fun =s1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim Str1 As String, Str2 As String Strl = InputBox(“请输入一个字符串”) Str2=Fun(Str1) Print Str2 End Sub 程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定” 按钮后在窗体上的输出结果为,

A.abcdefg

B.ABCDEFG

C.gfedcba

D.GFEDCBA

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“假定有以下函数过程:Function Fun(S AsStr…”相关的问题
第1题
假定有以下函数过程: FunctionFun(SAsString) AsString DimslAsString Fori=1ToLen(S) s

假定有以下函数过程: Function Fun(S As String) As String Dim sl As String For i=1 To Len(S) s1=UCase (Mid(S,i,1))+s1 Next i Fun=s1 End Function则Str2=Fun("abcdefg”)的输出结果为()。

A.abcdefg

B.ABCDEFG

C.gfedcba

D.GFEDCBA

点击查看答案
第2题
(33)假定有以下函数过程: Function Fun(S As String)As String Dim s1 As String For i=1 To L

(33)假定有以下函数过程:

Function Fun(S As String)As String

Dim s1 As String

For i=1 To Len(S)

s1=LCase(Mid(S, i, 1))+s1

Next i

Fun=s1

End Function

在窗体上画一个命令按钮,然后编写如下事件过程:

Private Sub Command1_Click()

Dim Str1 As String, Str2 As String

Str1=InputBox("请输入一个字符串")

Str2=Fun(Str1)

Print Srt2

End Sub

程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体

上的输出结果为()。

A)ABCDEFG

B)abcdefg

C)GFEDCBA

D)gfedcba

点击查看答案
第3题
设有以下函数过程:Functiofun(m As Integer)As Integer Dimk As Integer,sum As Integer sum=0 F

设有以下函数过程:

Functiofun(m As Integer)As Integer

Dimk As Integer,sum As Integer

sum=0

Fork=m To 1 Step-2

sum=sum+k

Nextk

fun=sum

End Function

若在程序中用语句s=fun(10)调用此函数,则s的值为______。

点击查看答案
第4题
设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:Private Sub Command1_Click() S

设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:

Private Sub Command1_Click()

Static x as integer

X=f(x+5)

Cls

Print x

End Sub

Private function f(x as integer)as integer

F=x+x

End function

连续单击命令按钮3次,第3次单击命令按钮后,窗体上显示的计算结果是

A)10

B)30

C)60

D)70

点击查看答案
第5题
设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEhd Function若已

设有以下函数过程

Private Function Fun(a()As Integer,b As String)As Integer

Ehd Function

若已有变量声明:

Dim x(5)As Integer,n As Integer,ch As String

则下面正确的过程凋用语句是

A.x(0)=Fun(x,“ch”)

B.n=Fun(n,ch)

C.Call Fun x,“ch”

D.n=Fun(x(5),ch)

点击查看答案
第6题
有以下函数过程:FunctionGys(ByValxAsInteger,ByValyAsInteger)AsIntegerDoWhiley<>0Reminder=xM

有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End Sub

A.0

B.10

C.50

D.100

点击查看答案
第7题
有如下函数过程。 Function Fun(By Val x As Integer,By Val y As Integer)As Integer Do While y

有如下函数过程。

Function Fun(By Val x As Integer,By Val y As Integer)As Integer

Do While y<>0

reminder=x Mod y

x=y

y=reminder

Loop

Fun=x

End Function

以下调用函数的事件过程,该程序的运行结果是

Private Sub Command7_Click()

Dim a As Integer,b As Integer

a=100:b=25

x=Fun(a,B)

Print x

End Sub

A.0

B.25

C.50

D.100

点击查看答案
第8题
设有以下函数过程:Function fun(a As Integer,b As Integer)Dim c As IntegerIf a<b Thenc=a:a=b

设有以下函数过程:

Function fun(a As Integer,b As Integer)

Dim c As Integer

If a<b Then

c=a:a=b:b=C

End IF

c=0

Do

c=c+a

Loop Until c Mod b=0

fun=c

End Function

若调用函数fun时的实际参数都是自然数,则函数返回的是()。

A.a、b的最大公约数

B.a、b的最小公倍数

C.a除以b的余数

D.a除以b的商的整数部分

点击查看答案
第9题
(25 )设有以下函数过程Function fun(a As Integer,b As Integer)Dim c As IntegerIf a<b The

(25 )设有以下函数过程

Function fun(a As Integer,b As Integer)

Dim c As Integer

If a<b Then

c=a:a=b:b=c

End If

c=0

Do

c=c+a

Loop Until c Mod b=0

fun=c

End function

若调用函数 fun 时的实际参数都是自然数,则函数返回的是

A ) a 、 b 的最大公约数

B ) a 、 b 的最小公倍数

C ) a 除以 b 的余数

D ) a 除以 b 的商的整数部分

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改