人民警察内务建设的原则是()。
A.从严治警、依法治警
B.高效务实、加强监督、着眼基层
C.公正廉明、英勇善战
D.无私无畏、雷厉风行
A.从严治警、依法治警
B.高效务实、加强监督、着眼基层
C.公正廉明、英勇善战
D.无私无畏、雷厉风行
第1题
阅读以下说明及Visual Basic程序代码,将应填入(n)处的字句写在对应栏内。
【说明】
以下程序为求行列式X(5,5)的值S。
【Visual Basic代码】
Private Function col (byval x (5,5 ) as integer ) as long
dim fesult as long
dim temp as long
dim I as integer
dim j as integer
dim k as imeger
result = 0
for I = to 5
(1)
for j = 1 to 5
if I+j>6 then
k= (1+j ) mod 5
else
k=1
endif
temp=temp*x (k,j )
(2)
result=(3)
(4)
(5)
End function
第2题
阅读以下说明及Visual Basic 程序代码,将应填入(n)处的字句写在对应栏内。
[说明]
本程序求3~100之间的所有素数(质数)并统计个数;同时将这些素数从小到大依次写入顺序文件E: \dataout.txt;素数的个数显示在窗体Form1上。
[Visual Basic 代码]
Private Sub Command1_ Click ()
Dim count as integer, flag as Boolean
Dim t1 as Integer, t2 as Integer
(1)
Count=0
For t1=3 to 100
Flag=Tree
For t2=2 to Int(Sqr (t1 ) )
If (2) Then flag=False
Next t2
(3)
count=(4)
write 1, t1
End if
Next t1
(5)
Close 1
End Sub
第3题
●试题六
阅读以下应用说明及Visual Basic部分程序代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
单击窗体上的"测试"(cmdTest)按钮,出现一个输入框,要求输入一串字符,将该字符串中的非字母字符删除后,显示在窗体中的一个文本框(txtShow)中。
【程序代码】
Private Sub cmdTest_Click()
Dim strT1,strT2 As String
Dim strCh As (1)
Dim intL As Integer
Dim intI As Integer
strT1= (2) ("请输入一串字符","字符串输入")
intL= (3)
strT2=″″
For intI=l To intL
strCh=Mid(strT1,intI,1)
If(strCh>"A"And (4) ) Or (strCh>"a" And suCh<"z")Then
strT2=strT2+strCh
End If
Next intI
txtShow.Text= (5)
End sub
第4题
试题三(共 15 分)
阅读以下说明和 C 程序,将应填入 (n) 处的字句写在答题纸的对应栏内。
第5题
阅读以下应用说明及Visual Basic程序代码,将应填入(n)处的字句写在对应栏内。
【说明8.1】
以下程序的功能是:生成20个200~300之间的随机整数,输出其中能被5整除的数并求出它们的和。
【程序代码8.1】
Private Sub Command1_Click()
For i=1 To 20
x=Int((1)*200+100)
If (2)=0 Then
Print x
S=S+ (3)
End If
Next i
Print"Sum=";S
End Sub
【说明8.2】
程序8.2运行后,单击窗体,则在窗体上显示的内容是:a=(4)和b=(5)。
【程序代码8.2】
Private Sub Form_Click()
Dim a As Integer,b As Integer
a=20:b=50
p1 a,b
p2 a,b
p3 a,b
Print"a=";a,"b=";b
End Sub
Sub p1(x As Integer, ByValy As Integer)
x=x+l0
y=y+20
End Sub
Sub p2(ByVal×As Integer, y As Integer)
x=x+l0
y=y+20
End Sub
Sub p3(ByVal×As Integer, ByVal y As Integer)
x=x+10
y=y+20
End Sub
第6题
阅读以下说明及Visual Basic程序代码,将应填入(n)处的字句写在对应栏内。
【说明】
在窗体上设计两个文本框和两个标签,标签上显示:“摄氏温度:”和“华氏温度:”,文本框一个用于输入摄氏温度数,一个用于输出对应的华氏温度。摄氏温度与华氏温度的转换公式为:c=(5/9)×(f-32)
要求:对输入的摄氏温度数有检查功能,以拒绝接收非数字字符。运行界面如图所示。
【Visual Basic代码】
Private Sub Commandl_Click ()
Text1 = ""
Text2 = ""
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
End Sub
Private Sub Command2 Click ()
End
End Sub
Private Sub Form. Load ()
Text1 = ""
Text2 = ""
Text1.Enabled = False
Text2.Enabled = False
End Sub
Private Sub Textl_Change ()
Text2.Text = (1)
End Sub
Private Sub Textl_KeyPress (KeyAscii As (2) )
If (3) Then
If Chr (KeyAscii ) < "0" Or (4) Then
(5)
End If
End If
End Sub
第7题
●试题七
阅读以下应用说明及Visual Basic程序代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
已知窗体上有两个名为cmdGene和cmdSort的命令按钮。单击cmdGene按钮时,随机产生10个[1,100]范围内的整数并将它们放在数组intA中;单击cmdSort按钮时,用选择法排序这10个数并输出。
【程序代码】
Dim intA(1 To 10)As Integer
Private Sub cmdGene_Click()
Dim intI As Integer
Randomize
For intI=1 To 10
intA(intI)= (1)
Next intI
End Sub
Private Sub cmdSort_Click()
Dim intI,intJ,intMin,intTemp As Integer
For intI=1 To 9
intMin=intA(intI)
For intJ= (2) To 10
If intA(intJ)<intMin Then
Temp=intA(intJ)
intA(intJ)= (3)
intMin=intTemp
End If
Next intJ
(4)
(5)
For intI=1 To 10
Print Str(intA(intI))+" ";
Next intI
Next IntI
End Sub
第8题
阅读以下应用说明及Visual Basic程序代码,将应填入(n)处的字句写在对应栏内。
【应用说明5.1】
本应用程序的窗体中有一个下拉式列表框(名称为Combo1)和两个文本框(名称分别为 Txt1和Txt2)。运行时,用户从Combo1的列表中进行选择,程序就会将选中条目的内容以及编号(从0开始)分别在文本框Txt1和Txt2中显示出来。
【程序代码5.1】
Private Sub Combo1_Click()
Txt1.Text = Combo1. (1)
Txt2.Text = Combo1. (2)
End Sub
(注:可供(2)处选择的选项:List, Index, Listlndex, ListCount, Number)
【应用说明5.2】
本应用程序的运行窗口如图2所示。
开发该应用的部分程序代码如下:
【程序代码5.2】
Private Sub CmbOp_Click()
Dim Dataln As Double,DataOut as Double
Dataln=(3)
Select Case (4)
Case "取整数部分"
DataOut =Int(Dataln)
Case "求平方根"
If Dataln<0 Then
MagBox "负数不能开平方!"
Else
DataOut = Sqr(Dataln)
End If
Case "取绝对值"
DataOut = Abs(Dataln)
(5)
TxtOut. Text = str $ (DataOut)
End Sub
第9题
阅读以下应用说明及Visual Basic部分程序代码,将应填入(n)处的字句写在对应栏内。
【说明】
在窗体上画一个名称为Combo1的组合框,画两个名称分别Labe11、Labe12及Caption属性分别为“城市名称”和空白的标签。程序运行后,当在组合框中输入一个新项后按回车键 (ASCII码为13)时,如果输入的项在组合框的列表中不存在,则自动添加到组合框的列表中,并在Labe12中给出提示“已成功添加输入项”;如果存在,则在Labe12中给出提示“输入项已在组合框中”。
【程序】
Private Sub Combo1 (1) (KeyAscii As Integer)
If KeyAscii=(2) Then
For i=0 To (3)
If Combo1. Text=(4) Then
Labe12. Caption ="输入项已在组合框中"
Exit Sub
End If
Next i
Label2. Caption ="已成功添加输入项"
Combo1. (5) Combo1.Text
End If
End Sub
第10题
●试题五
阅读以下应用说明、属性设置及Visual Basic程序代码,将应填入(n)处在字句写在答题纸的对应栏内。
【说明】
本应用程序的运行窗口如图2所示。
只要用户单击"闪烁"按钮,文字"欢迎光临"就会以0.3秒消失、0.3秒显示反复进行闪烁;单击"停止"按钮时,闪烁停止,恢复图示的初态。
在开发过程中,需要设置的属性如表1所示。
在开发过程中,需要编写的程序代码如下:
【程序】
Private Sub CmdF_Click()
Timer1. (3) =True
Labe1.Visible=False
End Sub
Private Sub Timer1_Timer()
(4) =not Label.Visible
End Sub
Private Sub CmdT_Click()
Timer1.Enabled= (5)
Labe1.Visible=true
End Sub
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!