In my Teacher Gradebook application, I'm creating a class called Student. The class will record all of a student's information like
I have no problems with properties that hold only one value. Here's the problem.Code:Public Class Student Private pFirstName As String = "" Private pLastName As String = "" Private pMinimumDGrade As Integer = 60 Private pMinimumCGrade As Integer = 70 Private pMinimumBGrade As Integer = 80 Private pMinimumAGrade As Integer = 90 Private pBookNumber As String 'Address stuff Private pAddress As String Private pCity As String Private pState As String = "OK" Private pZipCode As String Private pHomePhoneNumber As String Private pCellPhoneNumber As String Private pEmailAddress As String 'Parent Info - Mother Private pMotherFirstName As String Private pMotherLastName As String Private pMotherHomePhoneNumber As String Private pMotherWorkPhoneNumber As String Private pMotherCellPhoneNumber As String Private pMotherEmailAddress As String 'Parent Info - Father Private pFatherFirstName As String Private pFatherLastName As String Private pFatherHomePhoneNumber As String Private pFatherWorkPhoneNumber As String Private pFatherCellPhoneNumber As String Private pFatherEmailAddress As String Private pHomeworkAverage As String = "==" Private pTestAverage As String = "==" Private pQuizAverage As String = "==" Private pLabAverage As String = "==" Private pNineWeeksAverage As String = "==" Private pFinalNineWeeksAverage As String = "==" Private pSemesterAverage As String = "==" Private pFinalSemesterAverage As String = "==" End Class
For each student, I need to also keep a list of Grades on assignments. This needs to be a two dimensional array. Something like this.
In that way, I can grab the student's grade for any assignment from any of the four 9Weeks.Code:Student.Grade(Which9WeeksIndex,WhichGradeIndex) = 98
I also need to be able to get/set a NineWeeksAverage(Which9WeeksIndex) or a SemesterAverage(WhichSemesterIndex) in the same way.
I've been looking at Classes and OOP in general but I haven't figured out how to handle this situation yet.
I know it can be done though. I assume it will be something like the Rows and Columns collections in the DataGridView.
Any tips where to look or how to set this up? Will I need multiple classes to do this?




Reply With Quote