请各位帮忙看一下,这个程序有什么不足(输入exit不能退出,输入溢出后显示有问题),给我改进方法,谢谢
主体程序Module Module1
Sub Main()
Dim a As String
Dim st As New StudentClass
While True
Console.Write("输º?入¨?要°a查¨¦询¡¥的Ì?学¡ì号?(ꡧ1-5)ê?:êo")
a = Console.ReadLine()
If (a.Equals("exit")) Then
End If
Dim ID As String
ID = a
Select Case ID
Case "1"
st.stuID = "001"
st.stuName = "小?王ª?"
st.stuSex = "男D"
st.stuAge = "19"
st.stuClass = "通ª¡§信?"
st.stuJg = "南?京?"
Case "2"
st.stuID = "002"
st.stuName = "小?陈?"
st.stuSex = "男D"
st.stuAge = "21"
st.stuClass = "计?算?机¨²"
st.stuJg = "上¦?海¡ê"
Case "3"
st.stuID = "003"
st.stuName = "小?李¤?"
st.stuSex = "女?"
st.stuAge = "17"
st.stuClass = "软¨¨ª件t"
st.stuJg = "杭?州Y"
Case "4"
st.stuID = "004"
st.stuName = "小?张?"
st.stuSex = "女?"
st.stuAge = "20"
st.stuClass = "通ª¡§信?1"
st.stuJg = "天¬¨¬津¨°"
Case "5"
st.stuID = "005"
st.stuName = "小?赵?"
st.stuSex = "男D"
st.stuAge = "18"
st.stuClass = "软¨¨ª件t"
st.stuJg = "河¨®北À¡À"
Case Else
Console.WriteLine("超?出?查¨¦询¡¥范¤?围¡ì")
End Select
st.printStuInfo(st) '打䨰印®?查¨¦询¡¥结¨¢果?
End While
End Sub
End Module
类文件
Public Class StudentClass
Private _stuID As String '学¡ì号?
Private _stuName As String '名?字Á?
Private _stuSex As String '性?别Àe
Private _stuAge As String '年¨º龄¢?
Private _stuClass As String '班㨤级?
Private _stuJg As String '籍?贯¨¢
Public Sub printStuInfo(ByVal st As StudentClass)
Console.WriteLine("学¡ì号?:êo" & st.stuID)
Console.WriteLine("姓?名?:êo" & st.stuName)
Console.WriteLine("性?别Àe:êo" & st.stuSex)
Console.WriteLine("年¨º龄¢?:êo" & st.stuAge)
Console.WriteLine("班㨤级?:êo" & st.stuClass)
Console.WriteLine("籍?贯¨¢:êo" & st.stuJg)
End Sub
'属º?性?:êo学¡ì号?
Public Property stuID() As String
Get
Return _stuID
End Get
Set(ByVal value As String)
_stuID = value
End Set
End Property
'姓?名?
Public Property stuName() As String
Get
Return _stuName
End Get
Set(ByVal value As String)
_stuName = value
End Set
End Property
'性?别Àe
Public Property stuSex() As String
Get
Return _stuSex
End Get
Set(ByVal value As String)
_stuSex = value
End Set
End Property
'年¨º龄¢?
Public Property stuAge() As Integer
Get
Return _stuAge
End Get
Set(ByVal value As Integer)
_stuAge = value
End Set
End Property
'班㨤级?
Public Property stuClass() As String
Get
Return _stuClass
End Get
Set(ByVal value As String)
_stuClass = value
End Set
End Property
'籍?贯¨¢
Public Property stuJg() As String
Get
Return _stuJg
End Get
Set(ByVal value As String)
_stuJg = value
End Set
End Property
End Class