小学生 考试系统vb代码

来源:百度知道 编辑:UC知道 时间:2024/05/16 05:43:07
考试内容就是乘除加减4种方法!需要随即产生100题个、十、百位数字

乘除加减不是4种方法,而是20多种(包括混合运算),100个题,而且还需要个、十、百位数字,你想想程序量有多大。
如果你有小学课本的习题集,程序量可能会小一点。

Randmosize
For i=1 to 100
tmp1=int(rnd*150)
b=rnd
if b <1/4 then tmp1=tmp1 & "+"
if b >1/4 and b <1/2 then tmp1=tmp1 & "-"
if b >1/2 and b <3/4 then tmp1=tmp1 & "*"
if b >3/4 then tmp1=tmp1 & "/"
tmp1=tmp1 & int(rnd*150)
text1.text=text1.text & chr(10) & chr(13) & tmp1
next