用VB语言编写个程序,求本学习小组数学测验成绩的平均分和标准差
答案:1 悬赏:0 手机版
解决时间 2021-03-21 13:08
- 提问者网友:niaiwoma
- 2021-03-20 20:26
用VB语言编写个程序,求本学习小组数学测验成绩的平均分和标准差
最佳答案
- 五星知识达人网友:胯下狙击手
- 2021-03-20 21:59
'比如一个小组有8个人
Private Sub Command1_Click()
Dim n As Integer, sj() As Integer, p As Integer, b As Integer
n = 8
ReDim sj(8) As Integer
For i = 1 To n
sj(i) = InputBox("请输入第" & Str(i) & "个数")
Sum = Sum + sj(i)
Next i
p = Sum / n
For i = 1 To n
bb = bb + (sj(i) - p) ^ 2
Next i
b = Sqr(bb / n)
Print "平均数:" & Str(p)
Print "标准差:" & Str(b)
End Sub
Private Sub Command1_Click()
Dim n As Integer, sj() As Integer, p As Integer, b As Integer
n = 8
ReDim sj(8) As Integer
For i = 1 To n
sj(i) = InputBox("请输入第" & Str(i) & "个数")
Sum = Sum + sj(i)
Next i
p = Sum / n
For i = 1 To n
bb = bb + (sj(i) - p) ^ 2
Next i
b = Sqr(bb / n)
Print "平均数:" & Str(p)
Print "标准差:" & Str(b)
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯