mshd.net
当前位置:首页 >> vB编写一计算机自动出题并判断对错的程序 >>

vB编写一计算机自动出题并判断对错的程序

程序在附件中,望采纳!

Private Sub command1_click() '出题 Randomize Label1 = Int(Rnd * 9) + 1 '如果要两位数就把9改成99 Randomize Label3 = Int(Rnd * 9) + 1 Select Case Int(Rnd * 4) + 1 Case 1 Label2 = "+" Case 2 Label2 = "-" Case 3 Label2 = "×" Case...

Option Base 1 Dim a As Integer, b As Integer, c As Integer, n As Integer Private Sub Command1_Click() s = "+-×÷" Text1.Text = "" n = Int(Rnd(1) * 4) + 1 a = Int(9 * Rnd(1)) + 1 b = Int(9 * Rnd(1)) + 1 If n = 2 And a < b Then ...

Private Sub Command1_Click() Dim a, b As Integer Dim s As String Randomize a = Int(Rnd() * 100) b = Int(Rnd() * 100) s = CStr(a) Label1.Caption = s s = CStr(b) Label2.Caption = s End Sub Private Sub Command2_Click() Dim a, b, c...

首先存题入Access库时加上标志位,表明是选择题还是判断题 其次在窗体启动时随机产生最大为1500的100个随机数,分60个数存入数组a,40个数存入数组b 后面从数据库读数据的时候分2次读,一次全部读取出选择题到rs中,然后当显示的时候用rs.move(...

Private Sub Command1_Click() Dim a, b, c As Integer a = Int(Rnd * 101 + 1) b = Int(Rnd * 101 + 1) Print a; "+"; b; "=" End Sub 你试试 应该可以了 vb6.0的环境

参考: Private Sub Command1_Click() Dim a As String, b As Double Dim Scr As Object a = "5*10+2*5" Set Scr = CreateObject("MSScriptControl.ScriptControl") Scr.Language = "vbscript" b = Scr.Eval(a) End Sub

将题目类型、内容和答案以及评价都存储到TXT文件中,用“,”分隔。

网站首页 | 网站地图
All rights reserved Powered by www.mshd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com