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

Visual 4

This Visual Basic program calculates the average grades of 15 students across 3 subjects and displays the results by subject and by student. It uses arrays to store the grades inputted in text boxes for each subject and each student, calculates the average for each subject by summing the arrays and dividing by 15, and displays the averages in text boxes.
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)
49 views2 pages

Visual 4

This Visual Basic program calculates the average grades of 15 students across 3 subjects and displays the results by subject and by student. It uses arrays to store the grades inputted in text boxes for each subject and each student, calculates the average for each subject by summing the arrays and dividing by 15, and displays the averages in text boxes.
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

Programa en Visual que calcula el promedio de 15 alumnos en 3 materias y muestra los resultados

por materia y por alumno


Public Class Form1

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox11.TextChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim vec = {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6,
TextBox7, TextBox8, TextBox9, TextBox10, TextBox11, TextBox12, TextBox13, TextBox14,
TextBox15}
Dim vec2 = {TextBox16, TextBox17, TextBox18, TextBox19, TextBox20,
TextBox21, TextBox22, TextBox23, TextBox24, TextBox25, TextBox26, TextBox27,
TextBox28, TextBox29, TextBox30}
Dim vec3 = {TextBox31, TextBox32, TextBox33, TextBox34, TextBox35,
TextBox36, TextBox37, TextBox38, TextBox39, TextBox40, TextBox41, TextBox42,
TextBox43, TextBox44, TextBox45}
Dim vec4 = {TextBox46, TextBox47, TextBox48, TextBox49, TextBox50,
TextBox51, TextBox52, TextBox53, TextBox54, TextBox55, TextBox56, TextBox57,
TextBox58, TextBox59, TextBox60}
Dim vector(15), vector2(15), vector3(15), vector4(15), j, k, l, h, acum,
acum2, acum3, acum4 As Integer
For j = 0 To 14
vector(j) = vec(j).Text
Next
For j = 0 To 14
acum = acum + vector(j)
Next
TextBox61.Text = acum / 15
For k = 0 To 14
vector2(k) = vec2(k).Text
Next
For k = 0 To 14
acum2 = acum2 + vector2(k)
Next
TextBox62.Text = acum2 / 15
For l = 0 To 14
vector3(l) = vec3(l).Text
Next
For l = 0 To 14
acum3 = acum3 + vector3(l)
Next
TextBox63.Text = acum3 / 15
End Sub

Private Sub Label16_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label16.Click

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

End Sub
End Class

You might also like