Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
4. arreglos deber haro_jesus
1. UNIVERSIDAD CENTRAL DEL ECUADOR
Facultad de Filosofía, Letras y Ciencias de la Educación
Jesus Alexander Haro Amaguaya
Dennis Navarrete
Informática, Tercero B
Programación III
Msc. Víctor Zapata
7 de enero de 2018
Arreglos
• FORM1
o Diseño
o Código
Public Class Caratula
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Text = "UNIVERSIDAD CENTRAL DEL ECUADOR" + vbLf + vbLf + "FACULTAD
DE FILOSOFIA, LETRAS Y CIENCIAS DE LA EDUCACIÓN"
Label2.Text = "INFORMÁTICA" + vbLf + vbLf + "TERCERO B" + vbLf + vbLf +
"JESUS ALEXANDER HARO AMAGUAYA" + vbLf + vbLf + "DENNIS WILLIAMS NAVARRETE
CUACES" + vbLf + vbLf + "PROGRAMACIÓN III" + vbLf + vbLf + "MSC. VICTOR ZAPATA"
End Sub
Private Sub Ejercicio1ToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Ejercicio1ToolStripMenuItem.Click
MsgBox("Realizar la verificacion de números de cédula ecuatoriana",
MsgBoxStyle.Information, "Descripción del ejercicio")
Form1.Show()
Hide()
End Sub
Private Sub Ejercicio2ToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Ejercicio2ToolStripMenuItem.Click
MsgBox("Realizar un programa que ejecute las operaciones basicas con
matrices", MsgBoxStyle.Information, "Descripción del ejercicio")
Form2.Show()
2. Hide()
End Sub
Private Sub AyudaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles AyudaToolStripMenuItem.Click
End
End Sub
End Class
• FORM2
o Diseño
o Código
Public Class Form1
Dim sp, num, si, st, nv, ns, mul, pro As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.Clear()
TextBox2.Clear()
ComboBox1.SelectedItem = ""
Dim A(10) As Integer
Try
For i = 1 To 10 Step 1
num = InputBox("Ingrese valor " & i, "Cedula")
TextBox1.Text += CStr(num)
A(10) = num
Next
For i = 1 To 9 Step 2
mul = A(i) * 2
If mul > 9 Then
mul = mul - 9
End If
si = si + mul
Next
For i = 2 To 8 Step 2
sp = sp + A(i)
Next
st = sp + si
3. nv = st Mod 10
If nv = 0 Then
ns = nv
Else
ns = 10 - nv
End If
'Mensaje
If nv = A(10) Then
MsgBox("Cedula incorrecta")
Else
MsgBox("Cedula correcta")
End If
'Codigos de provincia
ComboBox1.Enabled = False
TextBox2.Text = Mid(TextBox1.Text, 1, 2)
pro = Val(TextBox2.Text)
Select Case pro
Case 1
ComboBox1.SelectedItem = "Azuay"
Case 2
ComboBox1.SelectedItem = "Bolivar"
Case 3
ComboBox1.SelectedItem = "Cañar"
Case 4
ComboBox1.SelectedItem = "Carchi"
Case 5
ComboBox1.SelectedItem = "Cotopaxi"
Case 6
ComboBox1.SelectedItem = "Chimborazo"
Case 7
ComboBox1.SelectedItem = "El Oro"
Case 8
ComboBox1.SelectedItem = "Esmeraldas"
Case 9
ComboBox1.SelectedItem = "Guayas"
Case 10
ComboBox1.SelectedItem = "Imbabura"
Case 11
ComboBox1.SelectedItem = "Loja"
Case 12
ComboBox1.SelectedItem = "Los Rios"
Case 13
ComboBox1.SelectedItem = "Manabi"
Case 14
ComboBox1.SelectedItem = "Morona Santiago"
Case 15
ComboBox1.SelectedItem = "Napo"
Case 16
ComboBox1.SelectedItem = "Pastaza"
Case 17
ComboBox1.SelectedItem = "Pichincha"
Case 18
ComboBox1.SelectedItem = "Tungurahua"
Case 19
ComboBox1.SelectedItem = "Zamora Chinchipe"
4. Case 20
ComboBox1.SelectedItem = "Galapagos"
Case 21
ComboBox1.SelectedItem = "Sucumbios"
Case 22
ComboBox1.SelectedItem = "Orellana"
Case 23
ComboBox1.SelectedItem = "Santo Domingo de los Tschilas"
Case 24
ComboBox1.SelectedItem = "Santa Elena"
End Select
Catch ex As Exception
MsgBox("Error de ingreso" & vbLf & "Intente nuevamente",
MsgBoxStyle.Critical, "Error")
TextBox1.Clear()
TextBox2.Clear()
ComboBox1.SelectedItem = ""
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Caratula.Show()
Hide()
End Sub
End Class
• FORM3
o Diseño
o Código
Public Class Form2
Dim f, c, f1, c1, f2, c2, vm As Byte
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
5. f1 = InputBox("Ingrese el numero de filas", "Matriz 1")
c1 = InputBox("Ingrese el numero de columnas", "Matriz 1")
f2 = InputBox("Ingrese el numero de filas", "Matriz 2")
c2 = InputBox("Ingrese el numero de columnas", "Matriz 2")
Matriz1.RowCount = f1
Matriz1.ColumnCount = c1
For i = 0 To c1 - 1
Matriz1.Columns(i).Width = 150 / c1
Next
For j = 0 To f1 - 1
Matriz1.Rows(j).Height = 150 / f1
Next
Matriz2.RowCount = f2
Matriz2.ColumnCount = c2
For i = 0 To c2 - 1
Matriz2.Columns(i).Width = 150 / c2
Next
For j = 0 To f2 - 1
Matriz2.Rows(j).Height = 150 / f2
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'Suma
If (ComboBox1.SelectedItem = "Suma") = True Then
If ((f1 = f2) And (c1 = c2)) = True Then
f = f1
c = c1
MatrizR.RowCount = f
MatrizR.ColumnCount = c
For i = 0 To c - 1
Matriz1.Columns(i).Width = 150 / c1
Next
For j = 0 To f - 1
Matriz1.Rows(j).Height = 150 / f1
Next
For i = 0 To c - 1
For j = 0 To f - 1
MatrizR.Rows(i).Cells(j).Value =
Val(Matriz1.Rows(i).Cells(j).Value) + Val(Matriz2.Rows(i).Cells(j).Value)
Next
Next
End If
End If
'Resta
If (ComboBox1.SelectedItem = "Resta") = True Then
If ((f1 = f2) And (c1 = c2)) = True Then
f = f1
c = c1
MatrizR.RowCount = f
MatrizR.ColumnCount = c
For i = 0 To c - 1
Matriz1.Columns(i).Width = 150 / c1
Next
For j = 0 To f - 1
Matriz1.Rows(j).Height = 150 / f1
6. Next
For i = 0 To c - 1
For j = 0 To f - 1
MatrizR.Rows(i).Cells(j).Value =
Val(Matriz1.Rows(i).Cells(j).Value) - Val(Matriz2.Rows(i).Cells(j).Value)
Next
Next
End If
End If
'Multiplicación
If (ComboBox1.SelectedItem = "Multiplicación") = True Then
If (c1 = f2) = True Then
f = f1
c = c2
MatrizR.RowCount = f
MatrizR.ColumnCount = c
For i = 0 To c - 1
Matriz1.Columns(i).Width = 150 / c1
Next
For j = 0 To f - 1
Matriz1.Rows(j).Height = 150 / f1
Next
For h = 0 To f - 1
For i = 0 To c - 1
vm = 0
For j = 0 To c - 1
vm = vm + Val(Matriz1.Rows(h).Cells(j).Value) *
Val(Matriz2.Rows(j).Cells(i).Value)
Next
MatrizR.Rows(h).Cells(i).Value = vm
Next
Next
End If
End If
'División
End Sub
End Class