我现在正在上计算机科学课,我只是不知道如何将 3 分的平均值转换为字母等级。起初我以为我可以做类似的事情:
PRINT name$(c); TAB(6) ; USING("###.#", average(c))
作为:
PRINT name$(c); TAB(6) ; USING("***something for text here***", average(c))
但是在我在互联网上搜索和搜索之后,我一无所获。过了一会儿,我重写了我的大部分代码,但它仍然不能正常工作。有人能告诉我我能做些什么来让它工作吗?
这里是:
dim names(20)
dim average$(20)
x = 0
input "Please input Teacher's name:"; teacher$
rem teacher$
cls
input "Input student's name:"; studentname$
do while studentname$ <> ""
name$(x)=studentname$
rem name$(x)
input "Input first number:"; e
input "Input second number:"; f
input "Input third number:"; g
avg$=(e+f+g)/3
average(x)= avg
x=x+1
cls
input "Input the next name or press enter to finish:"; studentname$
loop
print teacher$; "'s Class Report"
for c = 1 to X
if (avg$>89 and avg$<101) then let avg= "A" else if
if (avg$>79 and avg$<89) then let avg= "B" else if
if (avg$>69 and avg$<79) then let avg= "C" else if
if (avg$>59 and avg$<69) then let avg= "D" else if
if (avg$<59) then let avg= "F"; print names(c), TAB(6) average$(c)
next c
end