You are on page 1of 12

Vector 15 alumnos

Programa en visual basic 2010 que calcula el promedio de 15 alumnos en


diferentes materias.
Public Class Form1

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


System.EventArgs) Handles Button1.Click
Dim Fis = {TextBox1, TextBox5, TextBox9, TextBox13, TextBox17,
TextBox21, TextBox25, TextBox29, TextBox33, TextBox37, TextBox41,
TextBox45, TextBox49, TextBox53, TextBox57}
Dim Mat = {TextBox2, TextBox6, TextBox10, TextBox14, TextBox18,
TextBox22, TextBox26, TextBox30, TextBox34, TextBox38, TextBox42,
TextBox46, TextBox50, TextBox54, TextBox58}
Dim Quim = {TextBox3, TextBox7, TextBox11, TextBox15, TextBox19,
TextBox23, TextBox27, TextBox31, TextBox35, TextBox39, TextBox43,
TextBox47, TextBox51, TextBox55, TextBox59}
Dim Prom = {TextBox4, TextBox8, TextBox12, TextBox16, TextBox20,
TextBox24, TextBox28, TextBox32, TextBox36, TextBox40, TextBox44,
TextBox48, TextBox52, TextBox56, TextBox60}
Dim vector(15), a, b, c, d, acum, prome, mate, fisi, qui As Integer
mate = TextBox2.Text
fisi = TextBox1.Text
qui = TextBox3.Text
prome = (mate + fisi + qui) / 3
TextBox4.Text = prome

fisi = TextBox5.Text
mate = TextBox6.Text
qui = TextBox7.Text
prome = (mate + fisi + qui) / 3
TextBox8.Text = prome

fisi = TextBox9.Text
mate = TextBox10.Text
qui = TextBox11.Text
prome = (mate + fisi + qui) / 3
TextBox12.Text = prome

fisi = TextBox13.Text
mate = TextBox14.Text
qui = TextBox15.Text
prome = (mate + fisi + qui) / 3
TextBox16.Text = prome

fisi = TextBox17.Text
mate = TextBox18.Text
qui = TextBox19.Text
prome = (mate + fisi + qui) / 3
TextBox20.Text = prome

fisi = TextBox21.Text
mate = TextBox22.Text
qui = TextBox23.Text
prome = (mate + fisi + qui) / 3
TextBox24.Text = prome

fisi = TextBox25.Text
mate = TextBox26.Text
qui = TextBox27.Text
prome = (mate + fisi + qui) / 3
TextBox28.Text = prome

fisi = TextBox29.Text
mate = TextBox30.Text
qui = TextBox31.Text
prome = (mate + fisi + qui) / 3
TextBox32.Text = prome

fisi = TextBox33.Text
mate = TextBox34.Text
qui = TextBox35.Text
prome = (mate + fisi + qui) / 3
TextBox36.Text = prome

fisi = TextBox37.Text
mate = TextBox38.Text
qui = TextBox39.Text
prome = (mate + fisi + qui) / 3
TextBox40.Text = prome

fisi = TextBox41.Text
mate = TextBox42.Text
qui = TextBox43.Text
prome = (mate + fisi + qui) / 3
TextBox44.Text = prome

fisi = TextBox45.Text
mate = TextBox46.Text
qui = TextBox47.Text
prome = (mate + fisi + qui) / 3
TextBox48.Text = prome

fisi = TextBox49.Text
mate = TextBox50.Text
qui = TextBox51.Text
prome = (mate + fisi + qui) / 3
TextBox52.Text = prome

fisi = TextBox53.Text
mate = TextBox54.Text
qui = TextBox55.Text
prome = (mate + fisi + qui) / 3
TextBox56.Text = prome

fisi = TextBox57.Text
mate = TextBox58.Text
qui = TextBox59.Text
prome = (mate + fisi + qui) / 3
TextBox60.Text = prome

For d = 0 To 14
vector(d) = Prom(d).Text
Next
For d = 0 To 14
acum = acum + vector(d)

Next
TextBox64.Text = acum / 15

For a = 0 To 14
vector(a) = Fis(a).Text
Next
For a = 0 To 14
acum = acum + vector(a)

Next
TextBox61.Text = acum / 15

For b = 0 To 14
vector(b) = Mat(b).Text
Next
For b = 0 To 14
acum = acum + vector(b)

Next
TextBox62.Text = acum / 15

For c = 0 To 14
vector(c) = Quim(c).Text
Next
For c = 0 To 14
acum = acum + vector(c)

Next
TextBox63.Text = acum / 15

End Sub

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


As System.EventArgs) Handles TextBox1.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox2.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox3.TextChanged

End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox4.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox5.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox6.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox7.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox8.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox9.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox10.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox11.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox12.TextChanged

End Sub
Private Sub TextBox13_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox13.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox14.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox15.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox16.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox17.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox18.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox19.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox20.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox21.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox22.TextChanged
End Sub

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


As System.EventArgs) Handles TextBox23.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox24.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox25.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox26.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox27.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox28.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox29.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox30.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox31.TextChanged

End Sub
Private Sub TextBox32_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox32.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox33.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox34.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox35.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox36.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox37.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox38.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox39.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox40.TextChanged

End Sub
Private Sub TextBox41_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox41.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox42.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox43.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox44.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox45.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox46.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox47.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox48.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox49.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox50.TextChanged
End Sub

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


As System.EventArgs) Handles TextBox51.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox52.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox53.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox54.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox55.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox56.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox57.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox58.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox59.TextChanged

End Sub
Private Sub TextBox60_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox60.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox61.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox62.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox63.TextChanged

End Sub

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


As System.EventArgs) Handles TextBox64.TextChanged

End Sub

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


System.EventArgs) Handles MyBase.Load

End Sub
End Class

You might also like