javascript新手编程求解
计算GPA:页面上有一个“计算“按钮,点击后分别弹出输入各科成绩和各科学分的对话框,根据输入的成绩与学分可以计算出最后的学分绩GPA。参考下图界面所示,完成以下代码。(8分)<script language="javascript"><!--
function GPA(){
var grade_arr = new Array(50);
var score=_________ ("请输入各科成绩,以西文逗号分隔");
var point=_________ ("请输入各科学分,以西文逗号分隔");
if(score==null || point==null) return;
var score_arr=score.split (",");
var point_arr=point.split (",");
if(score_arr.length!= point_arr._________) return;
for(count=0; count<score_arr.length; count++){
if(score_arr[count]<=100 && score_arr[count]>=85)
grade_arr[count]=4;
if(score_arr[count]<85 && score_arr[count]>=75)
grade_arr[count]=3;
if(score_arr[count]<85 && score_arr[count]>=60)
grade_arr[count]=2;
if(score_arr[count]<60)
grade_arr[count]=1; }
for(count=0; count<_________.length; count++){
score_total += _________*_________;
point_total += _________;}
var GPA_point=score_total/point_total;
alert("GPA="+GPA_point);
}//--></script></head>
<body><input type="button" ___value______="计算" onclick="GPA()" /></body>