Can any1 just give a quick explination to each of these and what they do thanks.
Private Sub cmdAverage_Click()
picBox.Cls
picBox.Print "Name", "Ass1", "Ass2", "Ass3", "Total", "Average"
picBox.Print "__________________________________________________________________________"
For a = 1 To c
Average(a) = calAverage(ass1(a), ass2(a), ass3(a))
picBox.Print names(a), ass1(a), ass2(a), ass3(a), total(a), Average(a)
Next a
End Sub
Private Function calAverage(ass1 As Single, ass2 As Single, ass3 As Single) As Single
calAverage = (ass1 + ass2 + ass3) / 3
End Function
Private Sub cmdClean_Click()
picBox.Cls
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdGrade_Click()
picBox.Cls
picBox.Print "Name", "Ass1", "Ass2", "Ass3", "Total", "Average", "Grade"
picBox.Print "_________________________________________________________________________________"
For a = 1 To c
Grade(a) = calGrade(Average(a))
picBox.Print names(a), ass1(a), ass2(a), ass3(a), total(a), Average(a), Grade(a)
Next a
End Sub
Private Sub cmdRead_Click()
CommonDialog1.ShowOpen
c = 0
Do While Not EOF(1)
c = c + 1
Input #1, names(c), ass1(c), ass2(c), ass3(c)
Loop
picBox.Print "Name", "Ass1", "Ass2", "Ass3"
picBox.Print "_________________________________________________________________________________"
For a = 1 To c
picBox.Print names(a), ass1(a), ass2(a), ass3(a)
Next a
End Sub
Private Sub cmdReport_Click()
frmReport.Show
frmReport.Cls
frmReport.Print "Name", "Ass1", "Ass2", "Ass3", "Total", "Average", "Grade"
frmReport.Print "___________________________________________________________________________________________"
For a = 1 To c
Grade(a) = calGrade(Average(a))
frmReport.Print ; names(a), ass1(a), ass2(a), ass3(a), total(a), Average(a), Grade(a)
Next a
End Sub
Private Sub cmdTotal_Click()
picBox.Cls
picBox.Print "Name", "Ass1", "Ass2", "Ass3", "Total"
picBox.Print "_______________________________________________________________"
For a = 1 To c
total(a) = calTotal(ass1(a), ass2(a), ass3(a))
picBox.Print names(a), ass1(a), ass2(a), ass3(a), total(a)
Next a
End Sub
Private Function calTotal(ass1 As Single, ass2 As Single, ass3 As Single) As Single
calTotal = ass1 + ass2 + ass3
End Function
Private Sub Form_Load()
Open "H:\Vb\PROJECT\moving files\Ass1\result.txt" For Input As #1
CommonDialog1.Filter = "txtfile (*.txt) |*.txt"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Close #1
End Sub
Private Sub mnuAverage_Click()
cmdAverage_Click
End Sub
Private Sub mnuDeafult_Click()
cmdDeafult
End Sub
Private Sub mnuDisplay_Click()
cmdDisplay_Click
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuRead_Click()
cmdRead_Click
End Sub
Private Sub mnuTotal_Click()
cmdTotal_Click
End Sub
Private Function calGrade(Average As String) As String
If Average <= 49 Then
calGrade = "Unsuccessful"
ElseIf Average <= 64 Then
calGrade = "Pass"
ElseIf Average <= 79 Then
calGrade = "Merit"
Else
calGrade = "Distinction"
End If
End Function
Private Sub munReport_Click()
cmdReport_Click
End Sub