📄 class1.vb
字号:
Public Class student
Private snumber As Integer
Private sname As String
Private sTel As String
Private smathscore As Integer
Private scomputerscore As Integer
Private ssum As Integer
Private save As Double
Public Sub New()
Me.snumber = 70345
Me.sname = "zhang"
Me.sTel = 1391456655
Me.smathscore = 80
Me.scomputerscore = 90
Me.ssum = 170
Me.save = 85
End Sub
Public Sub New(ByVal snb As Integer, ByVal sn As String, ByVal st As Integer, ByVal sm As Integer, ByVal sc As Integer, ByVal ss As Integer, ByVal sa As Double)
Me.snumber = snb
Me.sname = sn
Me.sTel = st
Me.smathscore = sm
Me.scomputerscore = sc
Me.ssum = ss
Me.save = sa
End Sub
Public Property name() As String
Get
Return sname
End Get
Set(ByVal Value As String)
sname = Value
End Set
End Property
Public Property phone() As Integer
Get
Return sTel
End Get
Set(ByVal Value As Integer)
sTel = Value
End Set
End Property
Public Property number() As Integer
Get
Return snumber
End Get
Set(ByVal Value As Integer)
snumber = Value
End Set
End Property
Public Property math() As String
Get
Return smathscore
End Get
Set(ByVal Value As String)
smathscore = Value
End Set
End Property
Public Property computerscore() As Integer
Get
Return scomputerscore
End Get
Set(ByVal Value As Integer)
scomputerscore = Value
End Set
End Property
Public Function ave() As Integer
Dim x, y As Integer
Dim a As Double
a = (x + y) / 2
Return a
End Function
Public Function ssun() As Integer
Dim x, y As Integer
ssum = x + y
return ssum
End Function
Public Function studentinfo() As String
Dim s As String
Dim c1 As String = vbCrLf
s = s & "姓 名:" & Me.name & c1
s = s & "电话号码:" & Me.phone & c1
s = s & "学 号: " & Me.number & c1
s = s & " 数学成绩:" & Me.math & c1
s = s & "计算机成绩:" & Me.scomputerscore & c1
Return s
End Function
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -