在哪里可以买到军刺:求问2道简单的vb题目 ,急 谢谢

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 14:56:46
1.编程,在窗体的单击事件中完成:输入n,再输入n个学生成绩score,对这n个数的每一个,完成以下操作:根据成绩score,输出对应的等级表示。0≤score<60:不及格;60≤score<70:及格;70≤score<80:中;80≤score<90:良;90≤score≤100:优。输入其它数据时,输出为Error。如:
输入:3
输入:51, 输出:不合格
输入:78, 输出:中
输入:120,输出:Error

2.设计一个程序,运行界面如图所示。
“删除”是指在文本框中删除与用inputbox函数输入的字符(单个)相同的所有字符。
用复选框控制在删除时是否考虑大小写。
如果输入的是A,若为忽略大小写状态,则删除文本框中所有的字母A和a。

图为一个文本框,一个复选框,一个删除按钮
谢谢了啊

第二题还是我来写吧

Private Sub Command1_Click()
Dim ch As String, list As Variant
ch = InputBox("输入要过滤的字符", "字符过滤")
If Check1 Then
'复选框选中,进行字符二进制过滤
list = Split(Text1, ch, -1, vbBinaryCompare)
Text1 = Join(list, "")
Else
'复选框未选中,进行字符文本方式过滤
list = Split(Text1, ch, -1, vbTextCompare)
Text1 = Join(list, "")
End If
End Sub

============================

暴寒,看了半天一楼的答案,我才理解他所说的好久是有多久了...
这是根据一楼的答案改的"现代版的"程序
Private Sub Form_Click()
On Error Resume Next
Dim m As Integer, n As Integer
m = InputBox("输入人数")
For x = 1 To m
n = -1
n = InputBox("输入成绩")
If 0 <= n And n < 60 Then
Print "不合格"
ElseIf 60 <= n And n < 70 Then
Print "及格"
ElseIf 70 <= n And n < 80 Then
Print "中"
ElseIf 80 <= n And n < 90 Then
Print "良"
ElseIf 90 <= n And n <= 100 Then
Print "优"
Else
Print "Error"
End If

就算练手了!
1.
10 input m
20 for x=1 to m
30 n=0
40 input n
50 if 0<=n<60 then print "不合格" else 60
60 if 60<=n<70 then print "及格" else 70
70 if 70<=n<80 then print "中" else 80
80 if 80<=n<90 then print "良" else 90
90 if 90<=n<=100 then print "优" else 100
100 if n<0 or n>100 then print "Error"
110 next x
2.
好长时间不用了,忘了怎么编了,Sorry

这是qb,拜托!