Input and output Data

Enter your search terms Submit search form




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")
For j = 1 To 4
subjectName(j) = InputBox("Enter the Subject Name")
For k = 1 To 4
SubjectMark(k) = InputBox("Enter the Subject's Mark")
List1.AddItem "Code" & vbTab & "Subject" & "Mark"
For n = 1 To 4
List1.AddItem subjectCode(n) & vbTab & subjectName(n) & vbTab & SubjectMark(n)
End Sub






 [Back to VBToday]