当前位置:编程学习 > VB >>

vb高手进啊 这个程序中都有哪些语句

Dim i As Integer, j As Integer, k As Integer, x As Integer  '用于各种循环作循环变量Dim a1 As Single, a2 As Single, a3 As Single, a4 As Single  '用来累加各门功课的成绩,以后求各门功课的平均分Dim sname(1 To 100) As String      '用来存放姓名Dim s(1 To 100, 1 To 4) As Single  '用来存放每个人各科的成绩Dim c_50 As Integer, c_70 As Integer, c_80 As Integer, c_90 As Integer, c_100 As Integer   '用来统计处在各分数段的人数
Private Sub Form_Load()Text1.Visible = FalseListView1.Visible = FalsePicture1.Visible = FalseCommand2.Enabled = FalseCommand3.Enabled = FalseLabel6.Visible = TrueLabel6.Caption = "学生成绩统计程序"Form1.Caption = "学生成绩统计程序"
End Sub
Private Sub Command1_Click()Text1.Visible = TrueLabel6.Visible = FalsePicture1.Visible = FalseCommand3.Enabled = FalseCommand2.Enabled = TrueForm1.Caption = "学生成绩统计程序"fileno1 = FreeFile    '指定一个空路径Open App.Path & "\score.txt" For Input As #fileno1  '打开文件并指定文件打开的缓冲区i = 1a1 = 0a2 = 0a3 = 0a4 = 0Do While Not EOF(fileno1)      '防止读到文件末尾时出错   Input #fileno1, sname(i), s(i, 1), s(i, 2), s(i, 3)   '将文件中的内容放到数组中   s(i, 4) = (s(i, 1) + s(i, 2) + s(i, 3)) / 3           '求每位同学的平均分   a1 = a1 + s(i, 1)     '对各门成绩进行累加,以便后来求各科的平均成绩   a2 = a2 + s(i, 2)   a3 = a3 + s(i, 3)   a4 = a4 + s(i, 4)   i = i + 1LoopClose #fileno1       '关闭文件i = i - 1            '读入信息的个数s(i + 1, 1) = a1 / i     '求各科的平均成绩s(i + 1, 2) = a2 / is(i + 1, 3) = a3 / is(i + 1, 4) = a4 / iText1.Text = "读入了" & i & "名学生的信息"End Sub
Private Sub Command2_Click()ListView1.Visible = TrueCommand3.Enabled = TrueCommand2.Enabled = FalseFor j = 1 To i   ListView1.ListItems.Add(j) = sname(j)      '把数组中存放的姓名增加为该控件的行名称Next jListView1.ListItems.Add(i + 1) = "平均分"For k = 1 To 4  For j = 1 To i    ListView1.ListItems.Item(j).SubItems(k) = s(j, k)    '将各数组中存放的成绩放入到listview中  Next jNext kFor k = 1 To 4  ListView1.ListItems.Item(i + 1).SubItems(k) = s(i + 1, k)     '添加各科平均成绩Next k

End Sub
Private Sub Command3_Click()
Picture1.Visible = TrueListView1.Visible = FalseCommand2.Enabled = FalseCommand3.Enabled = FalseCommand1.Enabled = Truec_50 = 0c_70 = 0c_80 = 0c_90 = 0c_100 = 0For x = 1 To i               '统计处在各分数段的人数   Select Case s(x, 4)     Case Is < 50     c_50 = c_50 + 1     Case Is < 70     c_70 = c_70 + 1     Case Is < 80     c_80 = c_80 + 1     Case Is < 90     c_90 = c_90 + 1     Case Is < 100     c_100 = c_100 + 1   End SelectNext xLine3.Y1 = 1600 - c_50 * 70         '按照上面的统计结果绘图Line4.Y1 = 1600 - c_70 * 70Line5.Y1 = 1600 - c_80 * 70Line6.Y1 = 1600 - c_90 * 70Line7.Y1 = 1600 - c_100 * 70Form1.Caption = "学生成绩分布图"End Sub这段程序中都有哪些语句  说明一下。。。。。。
追问:都是什么语句
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,