为小学生设计一个用于100以内的加法练习程序。

来源:百度知道 编辑:UC知道 时间:2024/06/08 20:20:37
程序启动后自动产生两个100以内的随机整数显示在屏幕上,用户输入算式的答案后单击"确定"按钮,程序将算式显示出来并通过"√"或“×"给出判定,对出错的算式醒目显示,同时给出下一道题。
如果用户没有输入算式答案而直接单击"确定"按钮,程序将出错提示。
当用户单击"结束"按钮时,屏幕上显示共出题数、正确数、错误数和得分,其中得分计算方法为:得分=正确数/总数*100.
继续输入算式总数,并单击"确定"按钮,开始新一轮的加法练习。

这个很复杂 不会. 如果是100以内加法练习还可以 记录分数那些不会.
新建个文本档后缀名.txt. 粘贴一下代码:<html>
<head>
<title>小学生算数练习</title>

<script language=javascript>
function add()
{

var a,b,c,d,e,f,answer1,you,g,h;
a=Math.random()*10
b=Math.round(a);

c=Math.random()*10
d=Math.round(c);

e=Math.random()*10
f=Math.round(e);

answer1=b+d+f;
you=prompt(+b+"+"+d+"+"+f+"=?","请写出答案");
if(you==answer1) g=confirm("真聪明,你答对了,继续吗?");
else h=confirm("真可惜,再试一试吧。");
while(g==true||h==true)
{
var a,b,c,d,e,f,answer1,you,g,h;
a=Math.random()*100
b=Math.round(a);

c=Math.random()*100
d=Math.round(c);

e=Math.random()*100
f=Math.round(e);

answer1=b+d+f;
you=prompt(+b+"+"+d+"+"+f+"=?","请写出答案");
if(you==answer1) g=confirm(