Está en la página 1de 33

Nombre: Prez Trujillo Karla Michelle

Fecha: 21 de Enero 2016


No. Cuenta :314012483
Grupo:82A

CUESTIONARIO
1. Qu es un objeto? Cmo lo identificas en el cdigo ejemplo?
R=Un objeto es una combinacin de cdigo y datos que puede tratarse
como una unidad. Un objeto puede ser una porcin de una aplicacin,
como un control o un formulario.
Los objetos actan como bloques de creacin prefabricados para
programas: permiten escribir una porcin de cdigo y utilizarla una y
otra vez.
En el cdigo ejemplo el objeto es la etiqueta y el botn de comando
que se asigno a travs del programa, lugar donde se escribi el cdigo

2. Qu es un evento? Cmo lo identificas en el cdigo ejemplo?


R= Un evento es una seal que comunica a una aplicacin que ha
sucedido algo importante Los eventos tambin permiten que las tareas
separadas se comuniquen.
En el cdigo ejemplo un evento se ejecuta a partir de la asignacin de
un cdigo especfico para ese evento que en este caso fue el evento
click

3. Qu es una propiedad o atributo? En el cdigo Cual es?


R=Son etiquetas descriptivas aque proporcionan informacin adicional,
con los atributos, puede especificar los metadatos casi del mismo
modo en que utiliza palabras clave como Public y Private para
proporcionar informacin sobre niveles de acceso.
En el cdigo ejemplo se utiliza PRIVATE

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A
PRACTICA 2

Definicin del problema


Sumar dos nmeros enteros en visual basic.
Anlisis del problema

Se necesita una 4 etiquetas , 3 cajas de texto y un botn de comando


Asignar nombre a los objetos
Label1.Caption=Suma de dos numeros
Label2.Caption=Num1
Label3.Caption=Num2
Label4.Caption=RESULTADO
Command1.Caption=SUMAR
Para declarar una variable entera se escribe dentro de cada
procedimiento:

Dim Num1 As Integer


Dim Num2 As Integer
Para obtener valores se declaran:
Num1 = Val(Text1)
Num2 = Val(Text2)
Text3 = str(Num1 + Num2)

Diseo de la solucin del problema

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

a) Algoritmo
1. Inicio
2. Leer Num1
3. Leer Num2
4. Suma=Num1+Num2
5. Mostrar suma
6. Fin
b) Diagrama de flujo
INICIO

Num1

Num2

Suma=Num1+N

Mostrar suma

FIN

Desarrollo a la Solucin del Problema


'Nombre:Perez Trujillo Karla Michelle Grupo:82A
NCuenta:314012483
'Suma de dos numeros enteros
Private Sub Command1_Click()
Num1 = Val(Text1)
Num2 = Val(Text2)
Text3.Enabled = True
Text3 = Str(Num1 + Num2)
Text3.Enabled = False
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Private Sub Form_Load()


Label1.Caption = "Suma de dos numeros"
Label1.Alignment = 2
Label1.FontSize = 18
Label2.Caption = "Num1"
Label2.Alignment = 2
Label2.FontSize = 14
Label3.Caption = "Num2"
Label3.Alignment = 2
Label3.FontSize = 14
Label4.Caption = "Resultado"
Label4.Alignment = 2
Label4.FontSize = 14
Command1.Caption = "Suma"
Command1.FontSize = 14
Text3.Enabled = False
Text1.FontSize = 16
Text1.Alignment = 2
Text2.FontSize = 16
Text2.Alignment = 2
Text3.Alignment = 2
Text3.FontSize = 16
End Sub
Private Sub Text1_Change()
Dim Num1 As Integer
End Sub
Private Sub Text2_Change()
Dim Num2 As Integer
End Sub

'Nombre:Perez Trujillo Karla Michelle Grupo:82A


NCuenta:314012483
'Codigo del form. principal
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Load()

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Form1.Caption = "frmPrincipal"
Command1.Caption = "Cargar Formulario"
End Sub
'Codigo frm.Secundario
Private Sub Command1_Click()
Hide
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Hide
Set Form2 = Nothing
End Sub
Private Sub Form_Activate()
MsgBox ("Evento Activete")
End Sub
Private Sub Form_Deactivate()
MsgBox ("Evento Deactivete")
End Sub
Private Sub Form_Initialize()
MsgBox ("Evento Initialize")
End Sub
Private Sub Form_Load()
Form2.Caption = "frmSecundario"
Command1.Caption = "Hide"
Command2.Caption = "Unload"
Command3.Caption = "Terminate"
MsgBox ("Evento Load")
End Sub
Private Sub Form_Paint()
MsgBox ("Evento Paint")
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As
Integer)
MsgBox ("QuaryUnload")

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

End Sub
Private Sub Form_Terminate()
MsgBox ("Terminate")
End Sub
Private Sub Form_Unload(Cancel As Integer)
MsgBox ("Unload")
End Sub

1. Cules son los eventos que se cargan al iniciar un formulario?

2. Para qu sirve el evento "Initialize"?

3. Cundo se produce el evento "Unload"?

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A
4. Qu actividades NO se pueden hacer sobre el evento "load"?

5. Explica que hace el mtodo "hide" y el mtodo "show".

6. Qu hace el evento Activate y cuando se realiza?

7. En qu parte del compilador de Visual Basic se colocan los Mens?

8. qu hace el evento "Terminate"?

9. en tu practica, para que se usa la instruccin MsgBox?

10. Para que sirve el evento Paint?

PRACTICA 4
Definicin del problema
Pedirle al usuario lo siguientes datos : nombre ,edad ,estatura y
promedio escolar .
-Despus el programa debe de decirnos si el usuario es "Mayor de Edad" o "Menor de
edad".
-Si mide mas de 1.60 metros, "Alto" en caso contrario "Bajo"
-Si el promedio es mayor de 8.0 escribir "Buen aprovechamiento", si es menor
"Regular aprovechamiento"

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Anlisis del Problema


-Se necesitaran 1 etiqueta, 7 cajas de texto y un botn de comando
-Nombrar a los objetos
Text1.Text = "Cul es tu nombre?"
Text2.Text = "Qu edad tienes?"
Text3.Text = "Cunto mides?"
Text4.Text = "Cul es tu promedio escolar?"
Label1.Caption = "Ingresa los siguientes datos y obten tu
valoracin"
Command1.Caption = "Valoracin"
Text5.Text = ""

Text6.Text = ""
Text7.Text = ""
-Asignar el tipo de dato adecuado para las cajas de texto con las que
interactuara el usuario
Dim Text1 As String
Dim Text2 As Integer
Dim Text3 As Single
Dim Text4 As Single
-Para que la maquina le de sus valoraciones se tendr que utilizar la
sentencia ifthenelse
If Text2 > 18 Then
Text5 = "Eres mayor de edad"
Else
Text5 = "Eres Menor de Edad"
End If
If Text3 > 1.6 Then
Text6 = "Eres Alto"

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Else
Text6 = "Eres Bajo"
End If
If Text4 > 8 Then
Text7 = "Buen Aprovechamieto"
Else
Text7 = "Regular Aprovechamiento"
End If
Diseo de la solucin del problema
a) Algoritmo
1. Inicio
2. Leer Text1
3. Leer Text2
4. Leer Text3
5. Leer Text4
6. Si (Text2>18) entonces
Text5 = "Eres mayor de edad"
Sino
Text5 = "Eres Menor de Edad"
Finalizar
7. Si (Text3>1.60) entonces
Text6 = "Eres Alto"
Si no
Text6 = "Eres Bajo"
Finalizar
8. Si (Text4>8.0)entonces
Text7 = "Buen Aprovechamiento"
Text7 = "Regular Aprovechamiento"
Finalizar
9. FIN
b) Diagrama de flujo

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Private Sub Command1_Click()


Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = True
If Text2 > 18 Then
Text5 = "Eres mayor de edad"
Else
Text5 = "Eres Menor de Edad"
End If
If Text3 > 1.6 Then
Text6 = "Eres Alto"
Else
Text6 = "Eres Bajo"
End If
If Text4 > 8 Then
Text7 = "Buen Aprovechamiento"
Else
Text7 = "Regular
Aprovechamiento"
End If
End Sub
Desarrollo de la solucin
Text5.Enabled
= False
del problema
Text6.Enabled = False
Text7.Enabled
FalseTrujillo
'Nombre:=Perez
Private
Sub
Form_Load()
Karla Michelle
Text1.Text = "Cul es tu
NCuenta:314012483
nombre?"
'Practica 4
Text1.Alignment = 2
Text1.FontSize = 14
Text2.Text = "Qu edad tienes?"
Text2.Alignment = 2
Text2.FontSize = 14
Text3.Text = "Cunto mides?"
Text3.Alignment = 2
Text3.FontSize = 14
Text4.Text = "Cul es tu
promedio escolar?"
Text4.Alignment = 2
Text4.FontSize = 14

Label1.Caption = "Ingresa los


siguientes datos y obten tu
valoracin"
Label1.Alignment = 2
Label1.FontSize = 18
Label1.ForeColor = vbBlue
Command1.Caption = "Valoracin"
Command1.FontSize = 14
Text5.Text = ""
Text5.Alignment = 2
Text5.FontSize = 14
Text6.Text = ""
Text6.Alignment = 2
Text6.FontSize = 14
Text7.Text = ""
Text7.Alignment = 2
Text7.FontSize = 14
Form1.BackColor = vbBlack
End Sub
Private Sub Salir_Click()
MsgBox ("Salir")
End Sub
Private Sub Text1_Change()
Dim Text1 As String
End Sub
Private Sub Text1_Click()
Text1.Enabled = True
Text1.Text = ""
End Sub
Private Sub Text2_Change()
Dim Text2 As Integer
End Sub
Private Sub Text2_Click()
Text2.Enabled = True
Text2.Text = ""
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Private Sub Text3_Change()


Dim Text3 As Single
End Sub
Private Sub Text3_Click()
Text3.Enabled = True
Text3.Text = ""
End Sub
Private Sub Text4_Change()
Dim Text4 As Single
End Sub
Private Sub Text4_Click()
Text4.Enabled = True
Text4.Text = ""

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

End Sub
Private Sub Form_Terminate()
MsgBox ("Salir")
End Sub

Practica 6
Mini-calculadora

Definicin del problema

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Disear una calculadora que realice las operaciones bsicas (suma ,


resta, divisin, multiplicacin) agregando la exponenciacin y la raz en
visual basic
Anlisis del problema

-Se necesitaran 3 etiquetas, 3 cajas de texto y 6 botones de comando


-Asignar los nombres a los objetos :
Label1.Caption = "MINICALCULADORA"
Label2.Caption = ""
Label3.Caption = "="
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Command1.Caption = "+"
Command2.Caption = "-"
Command3.Caption = "/"
Command4.Caption = "*"
Command5.Caption = "^"
Command6.Caption = "raiz"
Command7.Caption=!(Factorial)
-Considerar el tipo de operador que utilizara cada comando
Command1----- Str(Num1 + Num2)
Command2----- Str(Num1 - Num2)
Command3----- Str(Num1 / Num2)
Command4----- Str(Num1 * Num2)
Command5----- Str(Num1 ^ Num2)
Command6----- Sqr(Num1)
Commanad7---

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

fac = 1
cont = 1
While (cont <= text1)
fac = fac * cont
cont = cont + 1
Wend
Text3 = Str(fac)
Diseo de la solucin del problema
a) Algoritmo
1.
2.
3.
4.
5.
6.
7.

Inicio
Leer num1
Leer num2
Suma
Resta
Divisin
Multiplicacin
8. Exponenciacin
9. Raz
10.
Fin

1. Suma
1. Suma=(num1+nu

m2)
2. Mostrar suma
3. Fin
1. Resta

2. Resta=( num1num2)
3. Mostrar resta
4. Fin

1. Exponenciacin
2. Exponenciacin=( num1^num

2)

3. Mostrar exponenciacin
4. Fin
1.
2.
3.
4.

Raz
Raiz= sqr(num1)
Mostrar raz
Fin

b) Diagrama de Flujo

1.
2.
3.
4.

1.
2.
3.
4.

Divisin

Divisin= (num1/num2)
Mostrar divisin
Fin

1. Multiplicacin
2. Multiplicacin=(num1*nu

m2)
3. Mostrar Multiplicacin
4. Fin

Factorial
fac = 1
cont = 1
While (cont <=
text1) fac = fac *
cont
cont =
cont + 1
5. Mostrar =
Str(fac)

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Text1.BackColor = vbWhite
Label2.Caption = "/"
Label2.Alignment = 2
Label2.FontSize = 26
Num1 = Val(Text1)
Num2 = Val(Text2)
Text3 = Str(Num1 / Num2)
End Sub

Private Sub Command4_Click()


Text1.Enabled = True
Text1.BackColor = vbWhite
Label2.Caption = "*"
Label2.Alignment = 2
Label2.FontSize = 28
Num1 = Val(Text1)
Num2 = Val(Text2)
Text3 = Str(Num1 * Num2)
End Sub
Private Sub Command5_Click()
Desarrollo a la solucin del problema

Text1.Enabled = True

Text1.BackColor = vbWhite
'Nombre: Perez Trujillo Karla Michelle NCuenta:314012483
Label2.Caption = "^"
'Practica 6
Label2.Alignment = 2
Private Sub Command1_Click()
Label2.FontSize = 28
Text1.Enabled = True
Num1 = Val(Text1)
Text1.BackColor = vbWhite
Num2 = Val(Text2)
Text3 = Str(Num1 ^ Num2)
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A
Label2.Caption = "+"
Label2.Alignment = 2
Label2.FontSize = 24
Num1 = Val(Text1)

Private Sub
Form_Load()

Num2 = Val(Text2)

Label1.Caption =
"MINICALCULADORA"
Text3 = Str(Num1 + Num2)
End Sub

Label1.Alignment = 2
Label1.FontSize = 16

PrivatePrivate
Sub Sub Command2_Click()
Label2.Caption = ""
Command6_Click()
Text1.Enabled = True Label3.Caption = "="
Text1.Enabled = False
Label3.Alignment = 2
Text1.BackColor = vbWhite
Text1.BackColor = vbBlack
Label2.Caption = "-" Label3.FontSize = 24
Label2.Caption = "raz"
Label2.Alignment = 2 Text1.Text = ""
Label2.Alignment = 2
Label2.FontSize = 30 Text1.Alignment = 2
Label2.FontSize = 22
Text1.FontSize = 20
Num1 = Val(Text1)
Num1 = Val(Text2)
Text2.Text = ""
Num2 = Val(Text2)
Text3 = Sqr(Num1)
Text2.Alignment = 2
Text3 = Str(Num1 - Num2)
End Sub
Text2.FontSize = 20
End Sub
Text3.Text = ""
Private Sub
Text3.FontSize = 20
Private Sub Command3_Click()
Command7_Click()
Text1.Enabled
Text2.Enabled
= False= True Text3.Alignment = 2
Command1.Caption =
text1.Enabled = True
"+"
Private Sub
Text2.BackColor
= Command5_Click()
vbBlack
Command1.FontSize =
Label2.Caption = "!"
24
Label2.FontSize = 30
fac = 1
cont = 1
While (cont <= text1)
fac = fac * cont
cont = cont + 1
Wend
Text3 = Str(fac)

Command2.Caption =
"-"
Command2.FontSize =
30
Command3.Caption =
"/"
Command3.FontSize =
26
Command4.Caption =
"*"

Command5.Caption = "^"
Command5.FontSize = 28
Command6.Caption = "raiz"
Command6.FontSize = 22
Command7.Caption = "!"
Command7.FontSize = 28

End Sub

Private Sub Text3_Change()


Dim text4 As Single
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

PRACTICA 7
Colores
Definicin
problema
Disear un
programa
tenga las
siguientes
opciones:

del

que
azul,

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

rojo, verde, amarillo, arriba y abajo. En cada opcin tendr que aparecer
automticamente un marco de asteriscos.
Anlisis del problema

Asignar 6 botones de opcin colocando 4 en un frame y 2 en otro , un


cuadro de texto.
Nombrar a los objetos:
Form1.Caption = "COLORES"
Frame1.Caption = "Colores"
Frame1.FontSize = 14
Option1.Caption = "Azul"
Option2.Caption = "Rojo"
Option3.Caption = "Verde"
Option4.Caption = "Amarillo"
Frame2.Caption = "Posicion"
Frame2.FontSize = 14
Option5.Caption = "Arriba"
Option6.Caption = "Abajo"

Boton2
Text1.BackColor = vbRed
Boton3
Text1.BackColor = vbGreen
Boton4
Text1.BackColor = vbYellow
Boton5
Text1.Top = 0
Boton6
Text1.Top = Form1.ScaleHeight Text1.Height

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Text1.Text = ""
Asignar las acciones que realizara cada botn
Boton1
Text1.BackColor = vbBlue
Text1.Enabled = False
Text1.FontSize = 14
Text1.Text = "**"
For cont = 1 To 41
Text1.Text = Text1.Text + "*"
Next
Text1 = Text1 & vbCrLf
For ren = 1 To 5
Text1 = Text1 & "*"
For esp = 1 To 58
Text1 = Text1 & " "
Next
Text1 = Text1 + "*"
Text1 = Text1 & vbCrLf
Next
For cont = 1 To 49
Text1.Text = Text1.Text + "*"
Next

Diseo de la solucin del problema


a) Algoritmo

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

1.
2.
3.
4.
5.
6.
7.
8.

Inicio
Azul
Rojo
Verde
Amarillo
Arriba
Abajo
Fin

1. Asteriscos
2. For cont= 1 To 41
Text1.text=Text1.text+*

Next
Text1 = Text1 & vbCrLf
3. For ren = 1 To 5
Text1 = Text1 & "*"

b) Diagrama de flujo

4. For esp = 1 To 58
Text1 = Text1 & " "
Next
Text1 = Text1 + "*"
Text1 = Text1 & vbCrLf
Next
5. For cont = 1 To 49
Text1.Text = Text1.Text
+ "*"
Next
6. Fin

Desarrollo de la solucin del problema


'Perez Trujillo Karla Michelle
'NCuenta:314012483 Grupo:82-A

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Private Sub Form_Load()


Form1.Caption = "COLORES"
Frame1.Caption = "Colores"
Frame1.FontSize = 14
Option1.Caption = "Azul"
Option2.Caption = "Rojo"
Option3.Caption = "Verde"
Option4.Caption =
"Amarillo"
Frame2.Caption = "Posicion"
Frame2.FontSize = 14
Option5.Caption = "Arriba"
Option6.Caption = "Abajo"
Text1.Text = ""
End Sub
Private Sub Option1_Click()
Text1.BackColor = vbBlue
Text1.Enabled = False
Text1.FontSize = 14
Text1.Text = "**"
For cont = 1 To 41
Text1.Text = Text1.Text + "*"
Next
Text1 = Text1 & vbCrLf
For ren = 1 To 5
Text1 = Text1 & "*"
For esp = 1 To 58
Text1 = Text1 & " "
Next
Text1 = Text1 + "*"
Text1 = Text1 & vbCrLf
Next
For cont = 1 To 49
Text1.Text = Text1.Text + "*"
Next

End Sub
Private Sub Option2_Click()
Text1.BackColor = vbRed
End Sub
Private Sub Option3_Click()
Text1.BackColor = vbGreen
End Sub
Private Sub Option4_Click()
Text1.BackColor = vbYellow
End Sub
Private Sub Option5_Click()
Text1.Top = 0
End Sub
Private Sub Option6_Click()
Text1.Top = Form1.ScaleHeight Text1.Height
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

PRACTICA 8
Palndromo
Definicin del problema
Identificar si una palabra o frase es un palndromo
Anlisis del problema

Asignar 1 cuadro de texto, 1 botn y 2 etiquetas


Nombrar a los objetos:
-Label1.Caption = "Ingresa tu frase"
-Text1.Text = ""
-Command1.Caption = "Comprobar"
-Label2.Caption = ""
Asignar el tipo de dato para cada variable
-Dim frase2 As String
-Dim frase As String
-Dim Pain As String
-Dim F As Integer
-Dim cont As Integer
Para leer el nmero de letras dentro de la frase o palabra se utiliza Len
Para eliminar espacios Replace(palin, " ", "")
Para saber si no es un palndromo se utilizara un ciclo de repeticin
For cont = 1 To F
frase = Mid(palin, cont, 1)

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

frase2 = Mid(palin, F, 1)
If frase = frase2 Then
F=F-1
Else
Label2.Caption = "No es un palindromo"
Diseo de la solucin del problema
a) Algoritmo
1.
2.
3.
4.
5.

Inicio
Leer Palin
Comprobar
Mostrar Es palindromo
Fin

1. Comprobar
2. For cont = 1 To F
frase = Mid(palin, cont, 1)
frase2 = Mid(palin, F, 1)
If frase = frase2 Then
F=F-1
Else
Label2.Caption = "No es
un palindromo"
3. Fin

b) Diagrama de Flujo

Desarrollo de la solucin del problema

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

'Perez Trujillo Karla Michelle


'NCuenta:314012483 Grupo:82-A
Private Sub Command1_Click()
palin = LCase(Text1.Text)
palin = Replace(palin, " ", "")
F = Len(palin)
Label2.Caption = "Es un
palindromo"
For cont = 1 To F
frase = Mid(palin, cont, 1)
frase2 = Mid(palin, F, 1)
If frase = frase2 Then
F=F-1
Else
Label2.Caption = "No es un
palindromo"
End If
Next
End Sub

Private Sub Form_Load()


Label1.Caption = "Ingresa tu
frase"
Label1.Alignment = 2
Label1.FontSize = 14
Label2.FontSize = 16
Text1.Text = ""
Command1.Caption =
"Comprobar"
Label2.Caption = ""
Dim frase2 As String
Dim frase As String
Dim Pain As String
Dim F As Integer
Dim cont As Integer
End Sub

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

For Letra = 1 To Len(frase)


If Mid(Text1, Letra, 1) = "a" Then numero = numero + 1
Next
Label2 = numero

Private Sub Command1_Click()


frase = LCase(Text1.Text)
Dim numero As Integer
Dim abc(1 To 27) As String
Dim texto As String
abc(1) = "a"
abc(2) = "b"
abc(3) = "c"
abc(4) = "d"
abc(5) = "e"
abc(6) = "f"
abc(7) = "g"
abc(8) = "h"
abc(9) = "i"
abc(10) = "j"
abc(11) = "k"
abc(12) = "l"
abc(13) = "m"
abc(14) = "n"
abc(15) = ""
abc(16) = "o"
abc(17) = "p"
abc(18) = "q"
abc(19) = "r"
abc(20) = "s"
abc(21) = "t"
abc(22) = "u"
abc(23) = "v"
abc(24) = "w"
abc(25) = "x" Mid(Text1, numero, 1)
abc(26) = "y"
abc(27) = "z"
For numero = 1 To Len(frase)
texto = Mid(Text1, numero,
texto = Mid(Text1, numero, 1)
Label2 = "a" & numero & vbCrLf

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Next
End Sub
Private Sub Form_Load()
Label1.Caption = "Ingresa tu texto"
Label1.FontSize = 14
Label2.Caption = " "
Text1.Text = " "
Command1.Caption = "#Letras"
Command1.FontSize = 14
End Sub
For Letra = 1 To Len(frase)
If Mid(Text1, Letra, 1) = abc(1) Then
numero = numero + 1
Text2.Text = "a" & numero
End If
Next
PROGRAMA DE CARACTERES

Private Sub Command1_Click()


frase = LCase(Text1.Text)
Dim Letra As Integer
Dim Letra2 As Integer
Dim numero As Integer
Dim abc(1 To 27) As String
abc(1) = "a"
abc(2) = "b"
abc(3) = "c"
abc(4) = "d"
abc(5) = "e"
abc(6) = "f"
abc(7) = "g"

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

abc(8) = "h"
abc(9) = "i"
abc(10) = "j"
abc(11) = "k"
abc(12) = "l"
abc(13) = "m"
abc(14) = "n"
abc(15) = ""
abc(16) = "o"
abc(17) = "p"
abc(18) = "q"
abc(19) = "r"
abc(20) = "s"
abc(21) = "t"
abc(22) = "u"
abc(23) = "v"
abc(24) = "w"
abc(25) = "x"
abc(26) = "y"
abc(27) = "z"

For Letra = 1 To 27
num = 0
For Letra2 = 1 To Len(Text1)
If Mid(Text1, Letra2, 1) = abc(Letra) Then
numero = numero + 1
End If
Next

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Label2.Caption = Label2.Caption & abc(Letra) & "=" & numero &


vbCrLf
Next

End Sub
PRACTICA DE MAYOR Y MENOR
Option Explicit
Private Sub Command1_Click()
Dim C(15) As Integer
Dim CONT As Integer
For CONT = 0 To 15
C(CONT) = InputBox("ingrese numeros")
List1.AddItem C(CONT)
List2.AddItem C(CONT)
Next
End Sub

Private Sub Command2_Click()


Dim i, n, s, p, a() As Integer
n = List1.ListCount
ReDim a(n)
For i = 0 To n - 1
a(i) = List1.List(i)
Next i
For i = 0 To n - 2
For s = i + 1 To n - 1
If a(i) > a(s) Then
p = a(i)
a(i) = a(s)

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

a(s) = p
End If
Next s
Next i
List1.Clear
For i = 0 To n - 1
List1.List(i) = a(i)
Next i
End Sub

Private Sub Command3_Click()


Dim i, n, s, p, a() As Integer
n = List1.ListCount
ReDim a(n)
For i = 0 To n - 1
a(i) = List2.List(i)
Next i
For i = 0 To n - 2
For s = i + 1 To n - 1
If a(i) < a(s) Then
p = a(i)
a(i) = a(s)
a(s) = p
End If
Next s
Next i
List2.Clear
For i = 0 To n - 1
List2.List(i) = a(i)

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Next i
End Sub
Private Sub Command1_Click()
Dim num, num1, num2, num3, raiz As Single
num1 = Val(Text1)
If num1 < 0 Then
MsgBox "No es valido"
Else
num2 = num1 / 2
num = num1 / num2
num3 = num + num2
raiz = 1 / 2 * num3
End If
raiz = 1 / 2 * ((num1 / raiz) + raiz)
resultado = raiz * raiz
If resultado = num1 + 0.0001 Then
text2 = raiz
Else
If resultado = num1 > num1 + 0.0001 < num1 + 0.005 Then
raiz = 1 / 2 * ((num1 / raiz) + raiz)
text2 = raiz
End If
End If
End Sub

Private Sub Form_Load()


Label1.Caption = "RAZ CUADRADA"
Label1.Alignment = 2

Nombre: Prez Trujillo Karla Michelle


Fecha: 21 de Enero 2016
No. Cuenta :314012483
Grupo:82A

Label1.FontSize = 14
Label2.Caption = "Ingresa un nmero real para obtener su raz cuadrada
"
Text1.Text = " "
Text1.FontSize = 14
Text1.Alignment = 2
text2.Text = " "
text2.FontSize = 14
text2.Alignment = 2
Command1.Caption = "Resultado"

End Sub

Private Sub Text1_Change()


Dim Text1 As Integer
End Sub

Private Sub Text2_Change()


Dim text2 As Single

End Sub

También podría gustarte