Ejercicios de programación .net (nivel inicial)
Se muestra el funcionamiento de los conceptos básicos para programar en .net Se muestra el funcionamiento de los conceptos básicos para programar en .net
Matrices Public Class Suma_Matrices Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim f1, c1, f2, c2, cont As Integer 'ingrese valores de matrices f1 = InputBox("Ingrese Fila Matriz 1") c1 = InputBox("Ingrese Columna Matriz 1") f2 = InputBox("Ingrese Fila Matriz 2") c2 = InputBox("Ingrese Columna Matriz 2") Dim mat1(f1, c1), mat2(f2, c2), matp(f1, c1) As Integer If f1 = f2 And c1 = c2 Then 'matriz 1 For i = 1 To f1 For j = 1 To c1 mat1(i, j) = InputBox("Ingrese Valores Matriz 1") ListBox1.Items.Add(mat1(i, j)) Next Next 'matriz 2 For i = 1 To f2 For j = 1 To c2 mat2(i, j) = InputBox("Ingrese Matriz 2") ListBox2.Items.Add(mat2(i, j)) Next Next 'suma 'para le resta cambiamos el signo "+" For i = 1 To f1 For j = 1 To c1 cont = mat1(i, j) + mat2(i, j) matp(i, j) = cont ListBox3.Items.Add(matp(i, j)) Next cont = 0 Next Else MsgBox("Matrices no iguales") End If End Sub End Class Leonel Navarrete
Aplicación Leonel Navarrete
- Page 21 and 22: Funciones Y Procedimientos Leonel N
- Page 23 and 24: Funciones Y Procedimientos Leonel N
- Page 25 and 26: Propiedades de los objetos Public C
- Page 27 and 28: Propiedades de los objetos Public C
- Page 29 and 30: Propiedades de los objetos Public C
- Page 31 and 32: Propiedades de los objetos Public C
- Page 33 and 34: Propiedades de los objetos Public C
- Page 35 and 36: Utilizando un Módulo Public Class
- Page 37 and 38: Utilizando un Módulo Public Class
- Page 39 and 40: Utilizando un Módulo Public Class
- Page 41 and 42: Public Class Form1 Private Sub Butt
- Page 43 and 44: Public Class Form2 Private Sub sala
- Page 45 and 46: MouseMove Public Class Form4 Privat
- Page 47 and 48: Tiempo del día Public Class Form1
- Page 49 and 50: Bucle For Public Class Form1 Privat
- Page 51 and 52: Public Class Form1 Private Sub Butt
- Page 53 and 54: Public Class Form3 Private Sub Butt
- Page 55 and 56: Public Class Form5 Private Sub Butt
- Page 57 and 58: Public Class Form7 Dim mensual As D
- Page 59 and 60: Serie Fibonacci Public Class Form1
- Page 61 and 62: Public Class Form1 Private Sub Butt
- Page 63 and 64: Número Primo Public Class Form1 Pr
- Page 65 and 66: Public Class Form1 Private Sub Chec
- Page 67 and 68: For each Public Class Form1 Private
- Page 69 and 70: Vectores sumar pares - impares Publ
- Page 71: Matrices Public Class Form1 Private
- Page 75 and 76: Private Sub Button2_Click(ByVal sen
- Page 77 and 78: Private Sub Button4_Click(ByVal sen
- Page 79 and 80: Public Class Form1 Private Sub Butt
- Page 81 and 82: While - Do - Do While Public Class
- Page 83: Private Sub Button2_Click(ByVal sen
Matrices<br />
Public Class Suma_Matrices<br />
Private Sub Button1_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />
System.EventArgs) Handles Button1.Click<br />
Dim f1, c1, f2, c2, cont As Integer<br />
'ingrese valores <strong>de</strong> matrices<br />
f1 = InputBox("Ingrese Fila Matriz 1")<br />
c1 = InputBox("Ingrese Columna Matriz 1")<br />
f2 = InputBox("Ingrese Fila Matriz 2")<br />
c2 = InputBox("Ingrese Columna Matriz 2")<br />
Dim mat1(f1, c1), mat2(f2, c2), matp(f1, c1) As Integer<br />
If f1 = f2 And c1 = c2 Then<br />
'matriz 1<br />
For i = 1 To f1<br />
For j = 1 To c1<br />
mat1(i, j) = InputBox("Ingrese Valores Matriz 1")<br />
ListBox1.Items.Add(mat1(i, j))<br />
Next<br />
Next<br />
'matriz 2<br />
For i = 1 To f2<br />
For j = 1 To c2<br />
mat2(i, j) = InputBox("Ingrese Matriz 2")<br />
ListBox2.Items.Add(mat2(i, j))<br />
Next<br />
Next<br />
'suma<br />
'para le resta cambiamos el signo "+"<br />
For i = 1 To f1<br />
For j = 1 To c1<br />
cont = mat1(i, j) + mat2(i, j)<br />
matp(i, j) = cont<br />
ListBox3.Items.Add(matp(i, j))<br />
Next<br />
cont = 0<br />
Next<br />
Else<br />
MsgBox("Matrices no iguales")<br />
End If<br />
End Sub<br />
End Class<br />
Leonel Navarrete