ok prof in college asked us to write a program for a simple gradebook.
iv wrote it 3 times and still cant get it right.
he wants it to be able to put in 10 names/ids and 10 grades,and get a listing of those grades getting an average.
im butchering this thing and getting no where.
this is how far iv gotten on this version of it iv written.
Public Class student
Private namevalue As String
Private maximumgrade As Integer
Public Sub New(ByVal namevalue As String, ByVal gradesArray As Integer)
maximumgrade = 0
End Sub
Private _grade1 As Decimal
Private _grade2 As Decimal
Private _grade3 As Decimal
Private _grade4 As Decimal
Private _grade5 As Decimal
Private _grade6 As Decimal
Private _grade7 As Decimal
Private _grade8 As Decimal
Private _grade9 As Decimal
Private _grade10 As Decimal
Public ReadOnly Property grade() As Decimal
Get
Return _grade1
End Get
End Property
Public ReadOnly Property grade2() As Decimal
Get
Return _grade2
End Get
End Property
Public ReadOnly Property grade3() As Decimal
Get
Return _grade3
End Get
End Property
Public ReadOnly Property grade4() As Decimal
Get
Return _grade4
End Get
End Property
Public ReadOnly Property grade5() As Decimal
Get
Return _grade5
End Get
End Property
Public ReadOnly Property grade6() As Decimal
Get
Return _grade6
End Get
End Property
Public ReadOnly Property grade7() As Decimal
Get
Return _grade7
End Get
End Property
Public ReadOnly Property grade8() As Decimal
Get
Return _grade8
End Get
End Property
Public ReadOnly Property grade9() As Decimal
Get
Return _grade9
End Get
End Property
Public ReadOnly Property grade10() As Decimal
Get
Return _grade10
End Get
End Property
Public Function average() As Decimal
While ((_grade1 + _grade2 + _grade3 + _grade4 + _grade5 + _grade6 + _grade7 + _grade8 + _grade9 + _grade10 / 10))
End While
End Function
End Class
any help in making it easyer would be aprcited, and tips on what im doing wrong an a lil explination of why its wrong (excuse the spelling been a very long day)