|
Today I came across an
interesting question under the Yahoo!Answer section, it goes
like this
"Visual Basic develop an
application to enter and display?
Hiya im a beginner lookin for
help or any tips on
how to develop an application to enter and display four
subjects
Basic Input Subject Code and the Subject names, and the
percentage mark are displayed
Any ideas on how to go about this
thanks for any help"
I came out with answer as shown
on the right |
Dim subjectCode(4),
subjectName(4) As String
Dim SubjectMark(4) As Single
Dim i, j, k, n As Integer
For i = 1 To 4
subjectCode(i) = InputBox("Enter the Subject Code")
Next
For j = 1 To 4
subjectName(j) = InputBox("Enter the Subject Name")
Next
For k = 1 To 4
SubjectMark(k) = InputBox("Enter the Subject's Mark")
Next
List1.AddItem "Code" & vbTab & "Subject" & "Mark"
For n = 1 To 4
List1.AddItem subjectCode(n) & vbTab & subjectName(n) &
vbTab & SubjectMark(n)
Next
End Sub
|