实验目的
设计一个用于100以内的加法练习程序。程序启动后自动产生两个100以内的随机整数显示在屏幕上,用户输入算式的答案后单机“确定”按钮,程序,程序将算式显示出来并通过“√”或“×”给出评判,对出错的算式以醒目形式显示。同时给出下一题。
实验内容
程序
HTML代码
<%@ Page Language=“C#” AutoEventWireup=“true” CodeFile=“Default.aspx.cs” Inherits="_Default" %>
</div>
<table class="auto-style1" align="center" border="1">
<tr>
<td class="auto-style3" colspan="2">
<h1><strong>在线模拟考试系统</strong></h1>
</td>
</tr>
<tr>
<td class="auto-style2">姓 名:</td>
<td class="auto-style7">
<asp:TextBox ID="txtName" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style5">准考证号:</td>
<td class="auto-style6">
<asp:TextBox ID="txtNo" runat="server" Width="250px"></asp:TextBox>
<br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtNo" ErrorMessage="准考证号必须由6位数字组成" ValidationExpression="\d{6}"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="auto-style4" colspan="2">
<asp:Button ID="btnOK" runat="server" Text="开始考试" OnClick="btnOK_Click" />
</td>
</tr>
</table>