题目
实验8:编写一个VB.NET程序,要求3个问题在同一个窗体内实现.在窗体上设置三个按钮,单击每个按钮,分别完成每个问题.
在窗体上放置1个文本框.在文本框中输入英文字符,单击按钮会将文本框中的所有大写字符转换为小写,所有小写字符转换为大写.如输入I Just MEET Her,则输出为i jUST meet hER.
输入一个学生的五门课的考试成绩,判断其是否为优秀.优秀的条件为:五门课成绩总分超过450分或每门课程在88以上或每门主课(前三门)的成绩都在95分以上其他课程在80分以上.
运输部门的货物运输与里程有关,距离越远,每吨货物的单价越低,假设每吨单价P与距离S之间的关系如下,
32 S
在窗体上放置1个文本框.在文本框中输入英文字符,单击按钮会将文本框中的所有大写字符转换为小写,所有小写字符转换为大写.如输入I Just MEET Her,则输出为i jUST meet hER.
输入一个学生的五门课的考试成绩,判断其是否为优秀.优秀的条件为:五门课成绩总分超过450分或每门课程在88以上或每门主课(前三门)的成绩都在95分以上其他课程在80分以上.
运输部门的货物运输与里程有关,距离越远,每吨货物的单价越低,假设每吨单价P与距离S之间的关系如下,
32 S
提问时间:2021-03-28
答案
第一题、
Private Sub Command1_Click()
Dim a As Integer, b As String, i As Integer, c() As String
a = Len(Text1.Text)
Print a
ReDim c(a) As String
For i = 1 To a
b = Mid(Text1.Text, i, 1)
Select Case b
Case "a" To "z"
c(i) = UCase(b)
Case "A" To "Z"
c(i) = LCase(b)
Case Else
c(i) = Chr(32)
End Select
Next i
Text1.Text = ""
For i = 1 To a
Text1.Text = Text1.Text & c(i)
Next i
End Sub
2、
Private Sub Form_click()
Dim a(5) As Double, i As Integer, j As Integer, k As Integer, sum As Double
Dim flag As Boolean, how As Boolean
For i = 1 To 5
a(i) = Val(InputBox("please input", "input number"))
sum = sum + a(i)
Next i
If sum > 450 Then
flag = True
how = True
End If
For k = 1 To 5
If a(k) > 88 Then
flag = True
how = True
End If
Next k
For j = 1 To 3
If a(j) > 95 Then flag = True
Next j
For k = 4 To 5
If a(k) > 80 Then how = True
Next k
If flag = True And how = True Then
Print "excellent"
End If
End Sub
3、Private Sub Form_click()
Dim s As Single, price As Single, total As Single
s = Text1.Text
If s < 100 Then
price = 32
ElseIf 100
Private Sub Command1_Click()
Dim a As Integer, b As String, i As Integer, c() As String
a = Len(Text1.Text)
Print a
ReDim c(a) As String
For i = 1 To a
b = Mid(Text1.Text, i, 1)
Select Case b
Case "a" To "z"
c(i) = UCase(b)
Case "A" To "Z"
c(i) = LCase(b)
Case Else
c(i) = Chr(32)
End Select
Next i
Text1.Text = ""
For i = 1 To a
Text1.Text = Text1.Text & c(i)
Next i
End Sub
2、
Private Sub Form_click()
Dim a(5) As Double, i As Integer, j As Integer, k As Integer, sum As Double
Dim flag As Boolean, how As Boolean
For i = 1 To 5
a(i) = Val(InputBox("please input", "input number"))
sum = sum + a(i)
Next i
If sum > 450 Then
flag = True
how = True
End If
For k = 1 To 5
If a(k) > 88 Then
flag = True
how = True
End If
Next k
For j = 1 To 3
If a(j) > 95 Then flag = True
Next j
For k = 4 To 5
If a(k) > 80 Then how = True
Next k
If flag = True And how = True Then
Print "excellent"
End If
End Sub
3、Private Sub Form_click()
Dim s As Single, price As Single, total As Single
s = Text1.Text
If s < 100 Then
price = 32
ElseIf 100
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1在直角三角形ABC中,角C为直角,若a=6,SinB=4/5求b和c的值
- 2小学英语单词记忆有什么好方法
- 3如图所示,AD为三角形ABC的高,E为AC上一点,BE交AD于F,且有BF=AC,FD=CD,BE与AC垂直吗
- 41、已知sin¤-cos¤=4/5,那么sin2¤=____
- 525×44=25○( )○( ) 在圆圈里填运算符号,括号里填合适的数.
- 6There are many good reasons to ride bicycles.这句话有错么?
- 7java题:一个球从100m高度自由落下,每次落地后反弹回原来高度的一半
- 8腾讯上的天气预告说“小雨转大雨-大雨”是什么意思?
- 9熟透了的蜜橘甜美多汁,它来自细胞结构的()
- 10Mingming usually waters the flowers every day划线提问
热门考点
- 1BEC中级,听力大概错10题,阅读错10~15题,作文应该能达到BAND3的要求,口语练得不多··这样能过吗
- 2Because modern facilities areemployed in the audio-visual lab,English teachers are required________
- 3六年级下册数学课堂作业本54页答案
- 4现在分词作定语和过去分词做定语有什么区别
- 5Here’s three pairs of shoes for her .那错?
- 6《石林》一道阅读题
- 7O为直线AB上一点,∠AOC的平分线是OM,∠BOC的平分线时候ON,求∠MON的度数
- 8How often does he ___(exercise)?
- 9A.B两种金属元素的相对原子质量之比为8:9,将两种金属按物质的量之比为3:2来组成的混合物1.26g.跟足量
- 10水果店运来荔枝和李子共102千克,李子和芒果共95千克,芒果和菠萝共96千克,荔枝和菠萝共多少千克?