题目内容:
以下程序的功能是:用户输入一个代表学生人数的正整数,程序以学生学号为下标创建一个数组(学号从1开始),然后依次输入每个学生的姓名、语文成绩、英语成绩和数学成绩,直到所有学生的信息输入完成,最后在窗体上打印信息。请在空白处填上适当的内容,将程序补充完整。【l】
Private Type student
Number As Integer
NameAs Strin9 * 8
Chinese As Integer
English As Integer
Maths As Integer
End Type
Private Sub Command l_Click()
Dim stu0 As student
Dim n As Integer,num As Integer,S As Integer,nam As String
Dim Chi_Score As Integer,Eng_ Score As Integer,Math_Score As Integer
n=Va1(InputBox(“请输入学生人数”))
【2】
S=l
While(s<=n)
msg=“请输入第”&Str(s)&“个学生的姓名”
nam=InputBox(msg)
Chi_Score=Va1(InputBox(“请输入该学生的语文成绩”))
Eng_Score=Va1(1nputBox(“请输入该学生的英语成绩”))
Math_Score=Va1(InputBox(“请输入该学生的数学成绩”))
stu(s).Number=S
stu(s).Name=ham
stu(s).Chinese=Chi_Score
stu(s).English=Eng_Score
stu(s).Maths=Math_Score
S=S+l
Wend
Print“学号”;Tab(8);“姓名”;Tab(16);“语文”;Tab(24);“英语”;Tab(32);“数学”
For i=1 To n
Print stu(i).Number;Tab(8);stu(i).Name;Tab(16);stu(i).Chinese;Tab(24);____
stu(i).English;Tab(32);stu(i).Maths
Next i
End Sub
参考答案:
答案解析: