我有这段代码,我花了太多时间,我想不通。它应该得到数字的平均值,然后输出答案。我输入名称,然后当我输入数字时,它只需要 1,之后我无法继续。我是小基础的初学者,很难理解这一点。我知道 Visual Basic 更高级,所以我在进入 Visual Basic 之前尝试理解简单的东西。如果我能得到一些建议,将不胜感激。
total=0
count=0
TextWindow.WriteLine("What is the students name? :")
name=TextWindow.Read()
While name<>""
TextWindow.Write(" Enter the grades :")
grades=textwindow.ReadNumber()
While grades<>""
total= total+grades
count=count+1
EndWhile
TextWindow.Write(name+ "average is" +total/grades)
TextWindow.WriteLine("Enter the name of another student or press enter to exit :")
name=textwindow.Read()