0% found this document useful (0 votes)
4 views2 pages

Comp Code

The document contains a Visual Basic code for an AttendanceForm that manages student attendance for 60 students. It allows marking attendance as present or absent, and saves the attendance records to a text file. The form populates a list of students and provides buttons for marking attendance and saving the records.

Uploaded by

adroll0776766349
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Comp Code

The document contains a Visual Basic code for an AttendanceForm that manages student attendance for 60 students. It allows marking attendance as present or absent, and saves the attendance records to a text file. The form populates a list of students and provides buttons for marking attendance and saving the records.

Uploaded by

adroll0776766349
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Imports System.

IO

Public Class AttendanceForm

Dim students(59) As String ' Assuming 60 students

Dim attendance(59) As Boolean ' True = Present, False = Absent

Private Sub AttendanceForm_Load(sender As Object, e As EventArgs) Handles [Link]

' Populate students array (you can load from DB/file)

For i = 0 To 59

students(i) = "Student " & (i + 1)

[Link](students(i))

Next

End Sub

Private Sub btnMark_Click(sender As Object, e As EventArgs) Handles [Link]

If [Link] <> -1 Then

Dim index As Integer = [Link]

attendance(index) = If([Link], True, False)

[Link](students(index) & " marked " & If(attendance(index), "Present", "Absent"))

End If

End Sub

Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles [Link]

' Save attendance to file (simple example)

Using writer As New StreamWriter("[Link]")


For i = 0 To 59

[Link](students(i) & "," & If(attendance(i), "Present", "Absent"))

Next

End Using

[Link]("Attendance saved!")

End Sub

End Class

You might also like