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
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim cuanto, par, impar, num, whi1, mayor, mayors, mayorss, d, d1 As Integer cuanto = Len(TextBox1.Text) TextBox2.Text = cuanto Do whi1 += 1 num = Mid(Val(TextBox1.Text), whi1, 1) If num Mod (2) = 0 Then par = num + par Else impar = num + impar End If Loop Until whi1 >= cuanto TextBox3.Text = par TextBox4.Text = impar TextBox5.Text = par + impar 'mayor Do mayor += 1 mayors = Mid(TextBox1.Text, mayor, 1) If mayors > mayorss Then mayorss = Mid(TextBox1.Text, mayor, 1) mayorss = mayors End If Loop Until mayor >= cuanto TextBox6.Text = mayorss 'menor mayor = 0 Do mayor += 1 mayors = Mid(TextBox1.Text, mayor, 1) If mayors < mayorss Then mayorss = Mid(TextBox1.Text, mayor, 1) mayorss = mayors End If Loop Until mayor >= cuanto TextBox7.Text = mayorss 'divisores Do d1 += 1 d = Val(TextBox1.Text) Mod d1 If d = 0 Then ListBox1.Items.Add(d1) End If Loop Until d1 >= Val(TextBox1.Text) End Sub Leonel Navarrete
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim cuanto, par, impar, num, whi1, mayor, mayors, mayorss, d, d1 As Integer End Sub cuanto = Len(TextBox1.Text) TextBox2.Text = cuanto Do While whi1 < cuanto whi1 += 1 num = Mid(Val(TextBox1.Text), whi1, 1) If num Mod (2) = 0 Then par = num + par Else impar = num + impar End If Loop TextBox3.Text = par TextBox4.Text = impar TextBox5.Text = par + impar 'mayor Do While mayor < cuanto mayor += 1 mayors = Mid(TextBox1.Text, mayor, 1) If mayors > mayorss Then mayorss = Mid(TextBox1.Text, mayor, 1) mayorss = mayors End If Loop TextBox6.Text = mayorss 'menor mayor = 0 Do While mayor < cuanto mayor += 1 mayors = Mid(TextBox1.Text, mayor, 1) If mayors < mayorss Then mayorss = Mid(TextBox1.Text, mayor, 1) mayorss = mayors End If Loop TextBox7.Text = mayorss 'divisores Do While d1
- 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 and 72: Matrices Public Class Form1 Private
- Page 73 and 74: Aplicación Leonel Navarrete
- Page 75: Private Sub Button2_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
Private Sub Button3_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />
System.EventArgs) Handles Button3.Click<br />
Dim cuanto, par, impar, num, whi1, mayor, mayors, mayorss, d, d1 As<br />
Integer<br />
cuanto = Len(TextBox1.Text)<br />
TextBox2.Text = cuanto<br />
Do<br />
whi1 += 1<br />
num = Mid(Val(TextBox1.Text), whi1, 1)<br />
If num Mod (2) = 0 Then<br />
par = num + par<br />
Else<br />
impar = num + impar<br />
End If<br />
Loop Until whi1 >= cuanto<br />
TextBox3.Text = par<br />
TextBox4.Text = impar<br />
TextBox5.Text = par + impar<br />
'mayor<br />
Do<br />
mayor += 1<br />
mayors = Mid(TextBox1.Text, mayor, 1)<br />
If mayors > mayorss Then<br />
mayorss = Mid(TextBox1.Text, mayor, 1)<br />
mayorss = mayors<br />
End If<br />
Loop Until mayor >= cuanto<br />
TextBox6.Text = mayorss<br />
'menor<br />
mayor = 0<br />
Do<br />
mayor += 1<br />
mayors = Mid(TextBox1.Text, mayor, 1)<br />
If mayors < mayorss Then<br />
mayorss = Mid(TextBox1.Text, mayor, 1)<br />
mayorss = mayors<br />
End If<br />
Loop Until mayor >= cuanto<br />
TextBox7.Text = mayorss<br />
'divisores<br />
Do<br />
d1 += 1<br />
d = Val(TextBox1.Text) Mod d1<br />
If d = 0 Then<br />
ListBox1.Items.Add(d1)<br />
End If<br />
Loop Until d1 >= Val(TextBox1.Text)<br />
End Sub<br />
Leonel Navarrete