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

Vector Sencillo Programa en Visual Basic Que Calcula El Promedio de 5 Alumnos

This Visual Basic program calculates the average of 5 students' scores. It contains text boxes to input each student's score, labels for each text box, and a button to calculate the average which is displayed in a sixth text box. When the button is clicked, it takes the values from each of the first 5 text boxes, converts them to integers, sums them, and divides the total by 5 to calculate the average score which is displayed in the sixth text box.

Uploaded by

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

Vector Sencillo Programa en Visual Basic Que Calcula El Promedio de 5 Alumnos

This Visual Basic program calculates the average of 5 students' scores. It contains text boxes to input each student's score, labels for each text box, and a button to calculate the average which is displayed in a sixth text box. When the button is clicked, it takes the values from each of the first 5 text boxes, converts them to integers, sums them, and divides the total by 5 to calculate the average score which is displayed in the sixth text box.

Uploaded by

juan balderas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Vector sencillo

Programa en visual basic que calcula el promedio de 5 alumnos.


Public Class Form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles


MyBase.Load

End Sub

Private Sub Label1_Click(sender As System.Object, e As System.EventArgs) Handles


Label1.Click

End Sub

Private Sub Label2_Click(sender As System.Object, e As System.EventArgs) Handles


Label2.Click

End Sub

Private Sub Label3_Click(sender As System.Object, e As System.EventArgs) Handles


Label3.Click

End Sub

Private Sub Label4_Click(sender As System.Object, e As System.EventArgs) Handles


Label4.Click

End Sub

Private Sub Label5_Click(sender As System.Object, e As System.EventArgs) Handles


Label5.Click

End Sub

Private Sub Label6_Click(sender As System.Object, e As System.EventArgs) Handles


Label6.Click

End Sub

Private Sub Label7_Click(sender As System.Object, e As System.EventArgs) Handles


Label7.Click

End Sub

Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox1.TextChanged

End Sub

Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox2.TextChanged

End Sub

Private Sub TextBox3_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox3.TextChanged
End Sub

Private Sub TextBox4_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox4.TextChanged

End Sub

Private Sub TextBox5_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox5.TextChanged

End Sub

Private Sub TextBox6_TextChanged(sender As System.Object, e As System.EventArgs)


Handles TextBox6.TextChanged

End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)


Handles Button1.Click
Dim vec = {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5}
Dim vector(5), j, acum As Integer
For j = 0 To 4
vector(j) = vec(j).Text
Next
For j = 0 To 4
acum = acum + vector(j)

Next
TextBox6.Text = acum / 5
End Sub
End Class

You might also like