Historico

Páginas: 6 (1324 palabras) Publicado: 22 de enero de 2013
PRACTICA #11


Private Sub CmdAceptar_Click()
If IsNumeric(TxtNumero) Then
Dim S As Integer, SI As Integer, SP As Integer
Dim May As Integer, Min As Integer
Dim Cad As String
Dim I As Integer, J As Integer
N = CLng(TxtNumero)
M = CLng(TxtNumero)
Cad = ""
I = 0
J = 1
S = SP = SI = 0
For J = 1 To N
If (N Mod J = 0) Then
Cad = Cad & J & vbCrLf
End If
Next J
While (N > 0)
If ((NMod 10) Mod 2) = 0 Then
SP = SP + (N Mod 10)
Else
SI = SI + (N Mod 10)
End If
S = S + (N Mod 10)
N = N \ 10
I = I + 1
Wend
May = Mid(TxtNumero, 1, 1)
Men = May
While (M > 0)
If May < (M Mod 10) Then
May = M Mod 10
End If
If Men > (M Mod 10) Then
Men = M Mod 10
End If
M = M \ 10
Wend
TxtCantCifras = Str(I)
TxtSumImpares = Str(SI)
TxtSumPares = Str(SP)
TxtSumTotal = Str(S)TxtCifraMayor = Str(May)
TxtCifraMenor = Str(Men)
TxtDivisores = Cad
Else
MsgBox "Debe ingresar un numero", vbCritical, "Mensaje"
TxtNumero.SetFocus
End If
End Sub

Private Sub CmdSalir_Click()
If MsgBox("¿Desea terminar la aplicacion?", vbQuestion + vbYesNo, "Pregunta") = vbYes Then
End
Else
Cancel = True
TxtNumero.SetFocus
End If
End Sub

Private Sub Form_Load()

End SubPRACTICA #12


Private Sub CmdAceptar_Click()
If IsNumeric(TxtNumero.Text) Then
LstNumero.AddItem TxtNumero.Text
TxtNumero.Text = ""
TxtNumero.SetFocus
Else
MsgBox "Ingrese un numero", vbCritical, "Mensaje"
TxtNumero.SelStart = 0
TxtNumero.SelLength = Len(TxtNumero.Text)
TxtNumero.SetFocus
End If
End SubPrivate Sub CmdOrdenar_Click()
Dim I As Integer, T As Integer, N As Integer
Dim A() As Integer
N = LstNumero.ListCount
ReDim A(N)
For I = 0 To N - 1
A(I) = LstNumero.List(I)
Next I
If OptAscendente.Value Then
For I = 0 To N - 2
For J = I + 1 To N - 1
If A(I) > A(J) Then
T = A(I)
A(I) = A(J)
A(J) = T
End If
Next J
Next I
End If
If OptDescendente.Value Then
For I = 0 To N - 2
For J =1 + 1 To N - 1
If A(I) < A(J) Then
T = A(I)
A(I) = A(I)
A(J) = T
End If
Next J
Next I
End If
LstNumero.Clear
For I = 0 To N - 1
LstNumero.List(I) = A(I)
Next I
End Sub


Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
If MsgBox("Desea terminar la aplicaciòn?", vbQuestion + vbYesNo, "Pregunta") = vbYes Then
End
Else: Cancel = True:TxtNumero.SetFocus
End If
End Sub








































PRACTICA #13


Private Type Articulo
Nombre As String * 30
Precio As Double
End Type
Dim A(4) As Articulo, Plazo As Integer
Const Interes = 0.12

Private Sub CboArticulo_Change()
Dim I As Integer
I = CboArticulo.ListIndex
TxtPrecio = A(I).Precio
End Sub

Private SubCboArticulo_Click()
Dim I As Integer
I = CboArticulo.ListIndex
TxtPrecio = A(I).Precio
End Sub

Private Sub CmdCuotaMensual_Click()
Dim Total As Double, CuotaMensual As Double, I As Integer
I = CboArticulo.ListIndex
Total = A(I).Precio * (1 + Interes)
CuotaMensual = Total / Plazo
MsgBox "Cuota Mensual US$" & Str(CuotaMensual)
End Sub

Private Sub CmdTotal_Click()
Dim Total As Double,I As Integer
I = CboArticulo.ListIndex
Total = A(I).Precio * (I + Interes)
MsgBox "Total US$" & Str(Total)
End Sub

Private Sub Form_Load()
A(0).Nombre = "Monitor SAMSUNG SyncMaster 3"
A(1).Nombre = "Impresora Hewlett Packard DeskJet 930C"
A(2).Nombre = "Impresora Epson Stylus Color 740"
A(3).Nombre = "Microprocesador Pentium I 233 MHZ"
A(0).Precio = 150: A(1).Precio = 275
A(2).Precio= 145: A(3).Precio = 80
Dim I As Integer
For I = 1 To 4
CboArticulo.AddItem A(I - 1).Nombre
Next I
TxtInteres = Interes: Plazo = 6
End Sub

Private Sub OptPlazo_Click(Index As Integer)
Select Case Index
Case 0: Plazo = 6
Case 1: Plazo = 12
Case 2: Plazo = 24
End Select
End Sub













































PRACTICA #14...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Histora
  • historicos
  • HISTOR
  • histora
  • Histor
  • Historicos
  • Histora
  • histora

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS