vb.net期末考试的简单介绍
如何在vb.net中实现单选题和多选题功能?
asp:RadioButton ID="RadioButton1" runat="server" Text="A." GroupName="group1"/
成都创新互联公司主营沧县网站建设的网络公司,主营网站建设方案,成都App定制开发,沧县h5微信小程序搭建,沧县网站营销推广欢迎沧县等地区企业咨询
asp:RadioButton ID="RadioButton2" runat="server" Text="B." GroupName="group1" /
asp:RadioButton ID="RadioButton3" runat="server" Text="C." GroupName="group1" /
asp:RadioButton ID="RadioButton4" runat="server" Text="D." GroupName="group1" /
div
asp:CheckBox ID="CheckBox1" runat="server" Text ="A." /
asp:CheckBox ID="CheckBox2" runat="server" Text ="B." /
asp:CheckBox ID="CheckBox3" runat="server" Text ="C." /
asp:CheckBox ID="CheckBox4" runat="server" Text ="D." /
/div
用VB.NET的FOR语句怎么编写1到100所有奇数的和啊 !!!马上要考试了 急!!!
dim sSum as long
for i=1 to 100
if i mod 2 =1 then
sSum=sSum + i
endif
next i
msgbox "1、100的奇数和为:" sSum,"提示"
==========================================
Sum 是关键字,是个系统函数
sSum 只是一个变量,晕,可以改成别的。
基于VB.NET的考试系统设计思路
根据试卷题目建立临时数据库,比如数学期末库。
然后将每个问题作为一个字段。用于存放答案。
每个学生的答题作为一条记录。
比如字段可以这样:题1,题2,
T1,T2a,T2b(第二大题第二个小题).... T3.......,有多少个需要答案的,就设定多少个字段。最后加上分数字段。初始值为0。
学生A的答案相对应录于数据库中:C,A,B。。。。。
学生B的答案相对应录于数据库中:A,A,C。。。。。
这样,不论考试学生多少,都可以。
二,判分数,那就是对数据库的分析了。
比如,T1的答案为C,那么选择所有T1字段值为C的加上相应的分数。比如5分。
update 数学期末库 set 分数=分数+5 where T1="c"
三,最好另建一个分数库,字段也按上面设定,只是类型改为数字,用于记录每一题的得分情况。这样总分各题分都清楚,便于分析总体和个体分数情况。
分数库各字段的值,依据期末库中答案来确定。
update 分数库 set T1F=5 where 数学期末库.T1="c"
update 分数库 set T2aF=3 where 数学期末库.T2a="A"
vb.net 关于2维数组求平均数的问题
如图?图呢?
Dim cj(10, 6) As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 1 To 2
cj(i, 0) = InputBox("输入第" i "位学生的学号")
cj(i, 1) = InputBox("输入数学")
cj(i, 2) = InputBox("输入心理学")
cj(i, 3) = InputBox("输入人事管理学成绩")
Next
Button2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i As Integer
For i = 1 To 10
MsgBox("学号为" cj(i, 0) "的学生平均成绩为:" (cj(i, 1) + cj(i, 2) + cj(i, 3) + cj(i, 4) + cj(i, 5) + cj(i, 6)) / 6)
Next
MsgBox("数学总平均成绩为:" (cj(1, 1) + cj(2, 1) + cj(3, 1) + cj(4, 1) + cj(5, 1) + cj(6, 1) + cj(7, 1) + cj(8, 1) + cj(9, 1) + cj(10, 1)) / 10)
End Sub
vb.net的编程
Option Strict Off
Option Explicit On
Friend Class Form1
Inherits System.Windows.Forms.Form
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
Dim j As Integer
Dim A(9) As Short
Dim D(9) As Short
Dim i As Short
Dim B As Short
Dim C As Short
Dim F As Short
Dim G As Boolean
Dim H() As Short
Dim K As Short
Dim S As String
C = 32767
For i = 1 To 10
A(i - 1) = CShort(InputBox("输入第 " i "个数"))
If B A(i - 1) Then B = A(i - 1)
If C A(i - 1) Then C = A(i - 1)
D(i - 1) = Int(Rnd() * 100 + 0.5)
If F D(i - 1) Then F = D(i - 1)
Next i
For i = 2 To 100
For j = 2 To Int(System.Math.Sqrt(i) + 0.5)
'UPGRADE_WARNING: Couldn't resolve default property of object j. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Mod has a new behavior. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
If i Mod j 0 Then
G = True
Else
G = False
Exit For
End If
Next j
If G = True Then
ReDim Preserve H(K)
H(K) = i
K = K + 1
End If
Next i
S = "2;"
For i = 0 To K - 1
S = S H(i) ";"
Next i
MsgBox("最大数为:" B ";最小数为:" C)
MsgBox("最大的随机数为:" F)
MsgBox("1--100之间共有" K + 1 "个素数:" S)
End Sub
End Class
新闻标题:vb.net期末考试的简单介绍
转载来于:http://ybzwz.com/article/docohdd.html