Vous êtes sur la page 1sur 6

//algoritmo para hallar el nmero perfecto de 3 nmeros digitados por teclado

//declaracin de variables
a, b, c : entero
inicio
Escribir (Digite el primer nmero:);
Leer (a);
Escribir (Digite el segundo nmero:)
Leer (b);
Escribir (Digite el tercer nmero:)
Leer (c);
Si (a>b)
Si (a>c)
Si (b>c)
Escribir ("el perfecto es:,b);
Si no
Escribir ("el perfecto es:,c);
Fin si
Sino
Escribir (el perfecto es:,a);
Fin si
Si no
Si (b>c)
Si (a>c)
Escribir ("el perfecto es:,a);
Si no
Escribir (el perfecto es:,c);
Fin si
Si no
Escribir ("el perfecto es:,b);
Fin si
Fin si
Fin

//Algoritmo para hallar el mayor de tres nmeros digitados por teclado


//declaracin de variables
a, b, c : entero
inicio
Escribir (Digite el primer nmero:);
Leer (a);
Escribir (Digite el segundo nmero:)
Leer (b);
Escribir (Digite el tercer nmero:)
Leer (c);
Si (a>b)
Si (a>c)
Escribir ("el nmero mayor es : ",a);
Si no
Escribir ("el nmero mayor es :",c);
Fin si
Si no
Si (b>c)
Escribir ("el nmero mayor es :",b);
Sino
Escribir ("el nmero mayor es : ",c);
Fin si
Fin si
Fin

Private Sub PORC_DESCUENTO_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
V_DESCUENTO.Text = Val(VALOR_TOTAL.Text) *
Val(PORC_DESCUENTO.Text) / 100
TOTAL_NETO.Text = Val(VALOR_TOTAL.Text) - Val(V_DESCUENTO.Text)
NUEVO.SetFocus
End If
End Sub
Private Sub SALIR_Click()
Dim Mensaje As Integer
Mensaje = MsgBox("Seguro que desea salir?", vbQuestion + vbYesNo,
"Facturacin")
If Mensaje = 6 Then
End
End If
End Sub
Private Sub TXTIVA1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA1.Text = Val(LBLSUB1.Caption) * Val(TXTIVA1.Text) / 100
TOTAL1.Text = Val(LBLSUB1.Caption) + Val(TXTV_IVA1.Text)
TXTCANT2.SetFocus
End If
End Sub
Private Sub TXTV_UNI1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB1.Caption = Val(TXTCANT1.Text) * Val(TXTV_UNI1.Text)
TXTIVA1.SetFocus
End If
End Sub
Private Sub TXTIVA2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA2.Text = Val(LBLSUB2.Caption) * Val(TXTIVA2.Text) / 100
TOTAL2.Text = Val(LBLSUB2.Caption) + Val(TXTV_IVA2.Text)
TXTCANT3.SetFocus
End If
End Sub
Private Sub TXTV_UNI2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB2.Caption = Val(TXTCANT2.Text) * Val(TXTV_UNI2.Text)
TXTIVA2.SetFocus
End If
End Sub

Private Sub TXTIVA3_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
TXTV_IVA3.Text = Val(LBLSUB3.Caption) * Val(TXTIVA3.Text) / 100
TOTAL3.Text = Val(LBLSUB3.Caption) + Val(TXTV_IVA3.Text)
TXTCANT4.SetFocus
End If
End Sub
Private Sub TXTV_UNI3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB3.Caption = Val(TXTCANT3.Text) * Val(TXTV_UNI3.Text)
TXTIVA3.SetFocus
End If
End Sub
Private Sub TXTIVA4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA4.Text = Val(LBLSUB4.Caption) * Val(TXTIVA4.Text) / 100
TOTAL4.Text = Val(LBLSUB4.Caption) + Val(TXTV_IVA4.Text)
TXTCANT5.SetFocus
End If
End Sub
Private Sub TXTV_UNI4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB4.Caption = Val(TXTCANT4.Text) * Val(TXTV_UNI4.Text)
TXTIVA4.SetFocus
End If
End Sub
Private Sub TXTIVA5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA5.Text = Val(LBLSUB5.Caption) * Val(TXTIVA5.Text) / 100
TOTAL5.Text = Val(LBLSUB5.Caption) + Val(TXTV_IVA5.Text)
TXTCANT6.SetFocus
End If
End Sub
Private Sub TXTV_UNI5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB5.Caption = Val(TXTCANT5.Text) * Val(TXTV_UNI5.Text)
TXTIVA5.SetFocus
End If
End Sub

Private Sub TXTIVA6_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
TXTV_IVA6.Text = Val(LBLSUB6.Caption) * Val(TXTIVA6.Text) / 100
TOTAL6.Text = Val(LBLSUB6.Caption) + Val(TXTV_IVA6.Text)
TXTCANT7.SetFocus
End If
End Sub
Private Sub TXTV_UNI6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB6.Caption = Val(TXTCANT6.Text) * Val(TXTV_UNI6.Text)
TXTIVA6.SetFocus
End If
End Sub
Private Sub TXTIVA7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA7.Text = Val(LBLSUB7.Caption) * Val(TXTIVA7.Text) / 100
TOTAL7.Text = Val(LBLSUB7.Caption) + Val(TXTV_IVA7.Text)
TXTCANT8.SetFocus
End If
End Sub
Private Sub TXTV_UNI7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB7.Caption = Val(TXTCANT7.Text) * Val(TXTV_UNI7.Text)
TXTIVA7.SetFocus
End If
End Sub
Private Sub TXTIVA8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA8.Text = Val(LBLSUB8.Caption) * Val(TXTIVA8.Text) / 100
TOTAL8.Text = Val(LBLSUB8.Caption) + Val(TXTV_IVA8.Text)
TXTCANT9.SetFocus
End If
End Sub
Private Sub TXTV_UNI8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB8.Caption = Val(TXTCANT8.Text) * Val(TXTV_UNI8.Text)
TXTIVA8.SetFocus
End If
End Sub

Private Sub TXTIVA9_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
TXTV_IVA9.Text = Val(LBLSUB9.Caption) * Val(TXTIVA9.Text) / 100
TOTAL9.Text = Val(LBLSUB9.Caption) + Val(TXTV_IVA9.Text)
TXTCANT10.SetFocus
End If
End Sub
Private Sub TXTV_UNI9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB9.Caption = Val(TXTCANT9.Text) * Val(TXTV_UNI9.Text)
TXTIVA9.SetFocus
End If
End Sub
Private Sub TXTIVA10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTV_IVA10.Text = Val(LBLSUB9.Caption) * Val(TXTIVA9.Text) / 100
TOTAL10.Text = Val(LBLSUB10.Caption) + Val(TXTV_IVA10.Text)
TOT_IVA.Caption = Val(TXTV_IVA1.Text) + Val(TXTV_IVA2.Text) +
Val(TXTV_IVA3.Text) + Val(TXTV_IVA4.Text) + Val(TXTV_IVA5.Text) +
Val(TXTV_IVA6.Text) + Val(TXTV_IVA7.Text) + Val(TXTV_IVA8.Text) +
Val(TXTV_IVA9.Text) + Val(TXTV_IVA10.Text)
VALOR_TOTAL.Text = Val(TOTAL1.Text) + Val(TOTAL2.Text) +
Val(TOTAL3.Text) + Val(TOTAL4.Text) + Val(TOTAL5.Text) + Val(TOTAL6.Text) +
Val(TOTAL7.Text) + Val(TOTAL8.Text) + Val(TOTAL9.Text) + Val(TOTAL10.Text)
PORC_DESCUENTO.SetFocus
End If
End Sub
Private Sub TXTV_UNI10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
LBLSUB10.Caption = Val(TXTCANT10.Text) * Val(TXTV_UNI10.Text)
TXTIVA10.SetFocus
End If
End Sub

Vous aimerez peut-être aussi