1.编写程序,计算2+4+6+...+100
2.从键盘上输入一个学生的的学号和考试成绩,然后输出该学生的学号和考试成绩,并根据成绩按下面的规定输出对该学生的评语:
成绩 80~100 60~79 50~59 40~49 0~39
评语 Very good Good Fair Poor Fail
我不要你说方法 就是详细步骤 写在卷子上能给分的 别让我查资料 能查到我也不会再问问上问 摆脱了
1.编写程序,计算2+4+6+...+100
2.从键盘上输入一个学生的的学号和考试成绩,然后输出该学生的学号和考试成绩,并根据成绩按下面的规定输出对该学生的评语:
成绩 80~100 60~79 50~59 40~49 0~39
评语 Very good Good Fair Poor Fail
我不要你说方法 就是详细步骤 写在卷子上能给分的 别让我查资料 能查到我也不会再问问上问 摆脱了
1:
For i = 2 To 100 Step 2
sum = sum + i
Next
msgbox sum
第二题:
Xh = Inputbox("请输入学号")
score = Val(Inputbox("请输入分数"))
Select Case score
Case Is < 60
str = "Fail"
Case 40 To 49
str = "Poor"
Case 50 To 59
str = "Fair"
Case 60 To 79
str = "good"
Case 80 To 100
str = "very good"
End Select
Print "学号:"; XH
Print "考试成绩"; score
Print "评语:"; str
第一题:
Dim i As Integer Dim sum As Integer sum = 0 For i = 2 To 100 Step 2 sum = sum + i Next i Print sum
第二题:
Dim id As Integer Dim score As Integer Dim str As String id = Val(Text1.Text) score = Val(Text2.Text) Select Case score Case Is < 60 str = "Fail" Case 40 To 49 str = "Poor" Case 50 To 59 str = "Fair" Case 60 To 79 str = "good" Case 80 To 100 str = "very good" End Select Print "学号:"; id Print "考试成绩"; score Print "评语:"; str
1:
dim index , sum
sum = 0
for index = 2 to 100 step 2
sum = sum + index
next