SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
TRABAJO DE GAMBAS              12/11/09             KENNY LOOR

            CODIGO FUENTE DE GAMBAS
                              CRONOMETRO

' Gambas class file
PUBLIC SUB Timer1_Timer()
  SEG.Text = Val(SEG.Text) + 1
  IF SEG.Text = 60 THEN
  MIN.Text = Val(MIN.Text) + 1
  SEG.Text = 0
  ENDIF
  IF MIN.Text = 60 THEN
  HOR.Text = Val(HOR.Text) + 1
  MIN.Text = 0
  ENDIF
 IF HOR.Text = 24 THEN
   HOR.Text = 0
   ENDIF
 END
PUBLIC SUB Button1_Click()
IF Button1.Text = "INICIAR" THEN
  Timer1.Enabled = TRUE
  Button1.Caption = "PARAR"
ELSE
IF Button1.Text = "PARAR" THEN
Timer1.Enabled = FALSE
Button1.Caption = "INICIAR"
ENDIF
ENDIF
END
PUBLIC SUB Button2_Click()
  FMain.Show
  CRONOMETRO1.Hide
END




                                                MAYOR DE 3
                                           ‘entre 3 números averiguar cuál
                                           es el mayor
                                           ‘el menor y el intermedio.

                                           PUBLIC SUB Main()

                                           DIM A, B, C AS Integer
                                           A= 6
                                           B = 10
                                           C = 80

                                           IF A > B AND A > C THEN
                                           PRINT "MAYOR ES..: " & A

                                   KENNY
TRABAJO DE GAMBAS               12/11/09   KENNY LOOR
IF C > B THEN
PRINT "INTERMEDIO ES..: " & C
PRINT "MENOR ES..: " & B
ELSE
PRINT "INTERMEDIO ES..: " & B
PRINT "MENOR ES..: " & C
ENDIF

ELSE
IF B > C THEN
PRINT "MAYOR ES..: " & B
 IF A > C THEN
PRINT "INTERMEDIO ES..: " & A
PRINT "MENOR ES..: " & C
ELSE
PRINT "INTERMEDIO ES..: " & C
PRINT "MENOR ES..: " & A
ENDIF

ELSE
PRINT "MAYOR ES..: " & C
IF A > B THEN
PRINT "INTERMEDIO ES..: " & A
PRINT "MENOR ES..: " & B
ELSE
PRINT "INTERMEDIO ES..: " & B
PRINT "MENOR ES..: " & A
ENDIF
ENDIF
ENDIF

END




                                  KENNY
TRABAJO DE GAMBAS   12/11/09   KENNY LOOR




                      KENNY
TRABAJO DE GAMBAS                          12/11/09      KENNY LOOR

                          DIGITO AUTOVERIFICADOR
PUBLIC SUB Main()
DIM B, C, D, E, F, G, H, I, J, K, W AS Integer
DIM A AS String
PRINT "INGRESE EL NUMERO DE CEDULA"
INPUT A

FOR B = 1 TO 9 STEP 1
C = Str(Mid(A, B, 1))
D = B MOD 2

IF D = 0 THEN
I=I+C
ELSE
H=C*2

IF H > 9 THEN
D = H MOD 10
E = Int(h / 10)
F=D+E
ELSE
F=H
ENDIF
G=G+F
ENDIF

NEXT
J=G+I
K = J MOD 10
W = 10 - K
PRINT "EL NUMERO VERIFICADOR DE LA CEDULA ES : "
PRINT W
END




                                                 KENNY
TRABAJO DE GAMBAS                       12/11/09                        KENNY LOOR

                                   EXPORTACION
'El Ecuador exporta cafe, cacao y maíz en qq, se desea calcular el total de las exportaciones
'y el porcentaje de cada producto exportado, con los siguientes datos
'MAIZ 300, CAFE 400, CACAO 800

PUBLIC SUB Main()
DIM A AS Integer
DIM B AS Integer
DIM C AS Integer
DIM S AS Integer
DIM P1 AS Float
DIM P2 AS Float
DIM P3 AS Float
A = 300
B = 400
C = 800
S=A+B+ C
P1 = A * 100 / S
P2 = B * 100 / S
P3 = C * 100 / S
PRINT "El Total de las exportaciones es..: " & S
PRINT "El porcentaje de MAIZ es..: " & P1 & "%"
PRINT "El porcentaje de CAFE es..: " & P2 & "%"
PRINT "El porcentaje de CACAO es..: " & P3 & "%"
END




                                    FUNCIONES
                                           KENNY
TRABAJO DE GAMBAS                   12/11/09                     KENNY LOOR

'PROCEDIMIENTO PRINCIPAL
PUBLIC SUB Main()
   DIM a, b, h, z AS Integer
   PRINT "Ingrese un número.:"
   INPUT a
   PRINT "Ingrese un número.:"
   INPUT b
   pintamedia(a, b)
   h = 30
   z = 70
   pintamedia(h, z)
END
'PROCEDIMIENTO 1
PUBLIC SUB pintamedia(v1 AS Integer, v2 AS Integer) AS Integer
  DIM s AS Integer
  s = v1 + v2
  PRINT "La suma es..: ", s
END




                                      KENNY
TRABAJO DE GAMBAS                          12/11/09                  KENNY LOOR


                                        PINTAMEDIA
PUBLIC SUB Main()
 DIM a, b AS Integer
   PRINT "Ingrese un número.:"
   INPUT a
   PRINT "Ingrese un número.:"
   INPUT b
   'Llamada a función suma, resta, multiplicación y división
   PRINT "La suma es..: ", suma(a, b)
   PRINT "La resta es..: ", resta(a, b)
   PRINT "La multiplicación es..: ", multiplicacion(a, b)
   PRINT "La división es..: ", division(a, b)
END
'Función suma
PUBLIC SUB suma(v1 AS Integer, v2 AS Integer) AS Integer
  DIM s AS Integer
  s = v1 + v2
  RETURN s
END
'Función resta
PUBLIC SUB resta(v1 AS Integer, v2 AS Integer) AS Integer
  DIM r AS Integer
  r = v1 - v2
  RETURN r
END
'Función multiplicación
PUBLIC SUB multiplicacion(v1 AS Integer, v2 AS Integer) AS Integer
  DIM m AS Integer
  m = v1 * v2
  RETURN m
END
'Función división
PUBLIC SUB division(v1 AS Integer, v2 AS Integer) AS Integer
  DIM d AS Integer
  d = v1 / v2
  RETURN d
E




                                               KENNY
TRABAJO DE GAMBAS                   12/11/09        KENNY LOOR

                                MODULO FIBONACCI
PUBLIC SUB Main()
 'Serie de Fibonacci
 DIM p, s, x, t AS Integer
 DIM fibo AS String
 p=0
 s=1
 fibo = Str(p) & " " & Str(s)
 WHILE x < 5
   t=p+s
   fibo = fibo & " " & Str(t)
   p=s
   s=t
   x=x+1
 WEND
   PRINT fibo
END




                                OBJETO SUPERHEROE
                                      KENNY
TRABAJO DE GAMBAS                 12/11/09      KENNY LOOR

PRIVATE Heroe1 AS NEW SUPERHEROE
PRIVATE Heroe2 AS NEW SUPERHEROE
PUBLIC SUB Main()

Heroe1.Nombre = "Superman"
Heroe1.Actor = "Ramón Zambrano"
Heroe1.Habilidad = "Volar"
Heroe1.Imprime()

WITH Heroe2
 .Nombre = "Batman"
 .Actor = "Ochoa"
 .Habilidad = "Visión Nocturna"
 .Imprime
END WITH

END




                           OBJETO SERES VIVOS
INHERITS SeresVivos
                                    KENNY
TRABAJO DE GAMBAS                12/11/09    KENNY LOOR

PRIVATE Nombre AS String
PRIVATE Apellido AS String

PUBLIC SUB PoneNombre(cadena AS String)
 Nombre = cadena
END
PUBLIC SUB PoneApellido(cadena AS String)
 Apellido = cadena
END

PUBLIC FUNCTION Nombrecompleto() AS String
 RETURN Nombre & " " & Apellido
END




                                    KENNY
TRABAJO DE GAMBAS                         12/11/09   KENNY LOOR

                               OBJETO VEHICULO
PRIVATE marca AS String
PRIVATE modelo AS Integer
PRIVATE precio AS Integer
PRIVATE color AS String
PRIVATE placa AS String
PUBLIC SUB mar(marca1 AS String)
 marca = marca1
END
PUBLIC SUB model(fecha AS String)
 modelo = fecha
END
PUBLIC SUB pre(valor AS Integer)
 precio = valor
END
PUBLIC SUB col(tinte AS String)
 color = tinte
END
PUBLIC SUB pla(codigo AS String)
 placa = codigo
END
PUBLIC FUNCTION marcaauto() AS String
 RETURN marca
END
PUBLIC FUNCTION modeloauto() AS String
 RETURN modelo
END
PUBLIC FUNCTION precioauto() AS Integer
 RETURN precio
END
PUBLIC FUNCTION colorauto() AS String
 RETURN color
END
PUBLIC FUNCTION placaauto() AS String
 RETURN placa
END




 OP                                                               ER
                                            KENNY
TRABAJO DE GAMBAS                        12/11/09      KENNY LOOR

                                 ACIONES BÁSICAS
PUBLIC SUB Button1_Click()
 suma.text = Val(num1.text) + Val(num2.text)
 resta.text = num1.text - num2.text
 multi.text = num1.text * num2.text
 divi.text = num1.text / num2.text
END

PUBLIC SUB Button2_Click()
 num1.text = ""
 num2.text = ""
 suma.text = ""
 resta.text = ""
 multi.text = ""
 divi.text = ""
END

PUBLIC SUB Button3_Click()
 ME.Close
END




                                               KENNY
TRABAJO DE GAMBAS                         12/11/09   KENNY LOOR


                                          VENTANA
PUBLIC SUB Main()
DIM vent AS window
vent = NEW window
vent.show()
END




                                           MENU
PUBLIC SUB Timer1_Timer()
segundos.text = Val(segundos.Text) + 1
 IF segundos.text = 59 THEN
 minutos.text = Val(minutos.text) + 1
 segundos.text = "0"
 segundos.text = Val(segundos.text) + 1
 ELSE
 IF minutos.text = 59 THEN
 horas.text = Val(horas.text) + 1
 minutos.text = "0"
 ENDIF
   ENDIF
END

PUBLIC SUB Button1_Click()
 IF Button1.text = "Iniciar" THEN
 Timer1.enabled = TRUE
 Button1.caption = "Parar"
 ELSE
 Timer1.Enabled = FALSE
 Button1.text = "Iniciar"
 ENDIF
END


                                            KENNY
TRABAJO DE GAMBAS                12/11/09                KENNY LOOR
PUBLIC SUB Button2_Click()
 segundos.text = "0"
 minutos.text = "0"
 horas.text = "0"
END




                                   JUEGO
PUBLIC SUB Button1_Click()
 DIM n1, n2, n3 AS Integer
 RANDOMIZE
 n1 = Int(Rnd() * 10)
 n2 = Int(Rnd() * 10)
 n3 = Int(Rnd() * 10)
 TextBox1.Text = n1
 TextBox2.Text = n2
 TextBox3.Text = n3
 IF n1 = n2 AND n1 = n3 THEN
  Message("GANASTES")
  TextBox5.Text = TextBox4.Text * 2
  ELSE
 IF n1 = 7 AND n2 = 7 AND n3 = 7 THEN
   Message("CONGRATULATIONS GANASTES EL PREMIO MAYOR")
   TextBox5.Text = TextBox4.Text * 4
    ENDIF
    ENDIF
END
PUBLIC SUB Button2_Click()
 ME.Close
END




                                   KENNY
TRABAJO DE GAMBAS                       12/11/09    KENNY LOOR




                                       GRÁFICOS
PUBLIC r AS Integer
PUBLIC posy AS Integer
PUBLIC posx AS Integer
PUBLIC al AS Integer
PUBLIC ba AS Integer
PUBLIC SUB Form_Open()
r = 20
END
PUBLIC SUB Button1_Click()
  posy = area1.Height / 2
  posx = area1.Width / 2
  Draw.Begin(area1)
  Draw.FillColor = Color.RGB(128, 255, 0)
  Draw.FillStyle = Fill.Solid
  Draw.Circle(posx, posy, r)
  r = r + 20
  'Draw.Ellipse(200, 200, 100, 50)
  Draw.End
END
PUBLIC SUB Button3_Click()
  ME.Close
END
PUBLIC SUB Button2_Click()
  area1.Clear
  posy = area1.Height / 2
  posx = area1.Width / 2
  Draw.Begin(area1)
  Draw.FillColor = Color.RGB(128, 255, 0)
                                            KENNY
TRABAJO DE GAMBAS                             12/11/09          KENNY LOOR
 Draw.FillStyle = Fill.Solid
 Draw.Circle(posx, posy, r)
 r = r - 20
 'Draw.Ellipse(200, 200, 100, 50)
 Draw.End
END
PUBLIC SUB Button4_Click()
 area1.Clear
 Draw.Begin(area1)
 posy = area1.Height / 2
 posx = area1.Width / 2
 Draw.FillColor = Color.RGB(255, 223, 117)
 Draw.FillStyle = Fill.Solid
 Draw.Rect(posx, posy, al, ba)
 Draw.End
 al = al + 10
 ba = ba + 10
END




                             PROTECTOR DE PANTALLA
PUBLIC C1 AS Integer
PUBLIC C2 AS Integer
PUBLIC C AS Integer
PUBLIC r AS Integer

PUBLIC SUB Button1_Click()
 IF Button1.Text = "Iniciar Fondo" THEN
 Timer1.Enabled = TRUE
 Button1.Caption = "Parar"
 ELSE
 Timer1.Enabled = FALSE
 Button1.Text = "Iniciar Fondo"
 ENDIF
END

PUBLIC SUB Button2_Click()
 ME.Close
END

PUBLIC SUB Timer1_Timer()
  C1 = Int(Rnd() * 700)
  C2 = Int(Rnd() * 700)
  C = Int(Rnd() * 15)
  Draw.Begin(area1)
  Draw.FillColor = Color.RGB((160 + c1), (2 + c2), (c1 + C2))
' coge los colores que se designen
  Draw.FillStyle = Fill.Solid
  Draw.Circle(C1, C2, C)
  Draw.End
END




                                                 KENNY
TRABAJO DE GAMBAS                 12/11/09     KENNY LOOR




                                 CALCULADORA
PUBLIC BAN AS Integer
PUBLIC OP1 AS Float
PUBLIC OP2 AS Float
PUBLIC SUB Button10_Click()
 visor.text = visor.Text & "0"
END
PUBLIC SUB Button11_Click()
 visor.text = visor.Text & "."
END
PUBLIC SUB Button7_Click()
 visor.text = visor.Text & "1"
END
PUBLIC SUB Button8_Click()
 visor.text = visor.Text & "2"
END
PUBLIC SUB Button9_Click()
 visor.text = visor.Text & "3"
END
PUBLIC SUB Button4_Click()
 visor.text = visor.Text & "4"
END
PUBLIC SUB Button5_Click()
 visor.text = visor.Text & "5"
END
PUBLIC SUB Button6_Click()
 visor.text = visor.Text & "6"
END
PUBLIC SUB Button1_Click()
 visor.text = visor.Text & "7"

                                    KENNY
TRABAJO DE GAMBAS                         12/11/09                          KENNY LOOR
END
PUBLIC SUB Button2_Click()
 visor.text = visor.Text & "8"
END
PUBLIC SUB Button3_Click()
 visor.text = visor.Text & "9"
END
PUBLIC SUB Button12_Click()
 ME.Close
END
PUBLIC SUB Button16_Click()
 visor.text = ""
END
PUBLIC FUNCTION operacion(v1 AS Float, v2 AS Float, opera AS Integer) AS Float
DIM re AS Float
  SELECT CASE opera
   CASE 1
     re = v1 + v2
   CASE 2
     re = v1 - v2
   CASE 3
     re = v1 * v2
   CASE 4
     re = v1 / v2
   CASE 5
     re = (v1 * v2) / 100
   CASE 6
     re = v1 ^ 2
   CASE 7
     re = v1 ^ 3
   CASE 8
     re = v1 ^ v2
   CASE 9
     re = 1 / v1
  END SELECT
  RETURN re
END
PUBLIC SUB Button13_Click()
 BAN = 1
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
END
PUBLIC SUB Button14_Click()
 BAN = 2
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
END
PUBLIC SUB Button18_Click()
 BAN = 3
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
                                             KENNY
TRABAJO DE GAMBAS                               12/11/09   KENNY LOOR
END
PUBLIC SUB Button17_Click()
 BAN = 4
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
END
PUBLIC SUB Button15_Click()
 IF visor.text <> 0 THEN
   OP2 = visor.Text
 ELSE
   OP2 = 0
 ENDIF
  visor.Text = operacion(OP1, OP2, BAN)
END
PUBLIC SUB Button19_Click()
  BAN = 5
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
END
PUBLIC SUB Button20_Click()
 BAN = 6
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.text = OP1
END
PUBLIC SUB Button21_Click()
 DIM valor, x1, x2, i AS Integer
 DIM cadena, cadena2 AS String
   valor = visor.Text
   WHILE valor > 0
      x1 = valor MOD 2
      x2 = Int(valor / 2)
      cadena = cadena & Str(x1)
      valor = x2
   WEND
     FOR i = Len(cadena) TO 1 STEP -1
      cadena2 = cadena2 & (Mid(cadena, i, 1))
   NEXT
   visor.text = cadena2
END
PUBLIC SUB Button22_Click()
 DIM valor, x1, x2, i AS Integer
 DIM cadena, cadena2 AS String
   valor = visor.Text
   WHILE valor > 0
      x1 = valor MOD 8
      x2 = Int(valor / 8)
      cadena = cadena & Str(x1)
      valor = x2
   WEND
   FOR i = Len(cadena) TO 1 STEP -1
      cadena2 = cadena2 & (Mid(cadena, i, 1))
                                                  KENNY
TRABAJO DE GAMBAS                             12/11/09   KENNY LOOR
   NEXT
   visor.text = cadena2
END
PUBLIC SUB Button23_Click()
 DIM valor, x1, x2, i AS Integer
 DIM cadena, cadena2 AS String
 valor = visor.Text
  WHILE valor > 0
    x1 = valor MOD 16
    x2 = Int(valor / 16)
    IF x1 = 10 THEN
    cadena = cadena & "A"
    ELSE
    IF x1 = 11 THEN
    cadena = cadena & "B"
    ELSE
    IF x1 = 12 THEN
    cadena = cadena & "C"
    ELSE
    IF x1 = 13 THEN
    cadena = cadena & "D"
    ELSE
    IF x1 = 14 THEN
    cadena = cadena & "E"
    ELSE
    IF x1 = 15 THEN
    cadena = cadena & "F"
    ELSE
    cadena = cadena & Str(x1)
   ENDIF
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    valor = x2
 WEND
 FOR i = Len(cadena) TO 1 STEP -1
    cadena2 = cadena2 & (Mid(cadena, i, 1))
  NEXT
 visor.Text = cadena2
END
PUBLIC SUB Button24_Click()
 BAN = 7
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.text = OP1
END
PUBLIC SUB Button27_Click()
  BAN = 8
 IF visor.text <> 0 THEN
   OP1 = visor.Text
 ELSE
   OP1 = 0
 ENDIF
 visor.Clear
END
PUBLIC SUB Button25_Click()
 BAN = 9
 IF visor.text <> 0 THEN
                                                KENNY
TRABAJO DE GAMBAS                         12/11/09                 KENNY LOOR
    OP1 = visor.Text
 ELSE
    OP1 = 0
 ENDIF
 visor.text = OP1
END
PUBLIC SUB Button26_Click()
 DIM a, b AS Long
 DIM valor AS Integer
 valor = visor.Text
 b=1
 FOR a = valor TO 1 STEP -1
 b=b*a
 NEXT
 visor.Text = b
END
PUBLIC SUB Button28_Click()
 DIM r AS Float
 r = Rad(visor.text)
 visor.text = Sin(r)
END
PUBLIC SUB Button29_Click()
  DIM r AS Float
  r = Rad(visor.text)
  visor.text = Cos(r)
END
PUBLIC SUB Button30_Click()
 DIM r AS Float
 r = Rad(visor.text)
 visor.text = Tan(r)
END



                         CONVIERTE NÚMERO A LETRAS
PUBLIC FUNCTION EnLetras(numero AS String) AS String
  DIM b, paso AS Integer
  DIM expresion, entero, deci, flag AS String
  flag = "N"
  FOR paso = 1 TO Len(numero)
     IF Mid(numero, paso, 1) = "." THEN
       flag = "S"
     ELSE
       IF flag = "N" THEN
          entero = entero & Mid(numero, paso, 1)
       ELSE
          deci = deci & Mid(numero, paso, 1)
       END IF
     END IF
  NEXT

  IF Len(deci) = 1 THEN
     deci = deci & "0"
  END IF
  flag = "N"
  IF Val(numero) >= -999999999 AND Val(numero) <= 999999999 THEN

    FOR paso = Len(entero) TO 1 STEP -1
      b = Len(entero) - (paso - 1)

      SELECT CASE paso
      CASE 3, 6, 9

                                            KENNY
TRABAJO DE GAMBAS                       12/11/09                              KENNY LOOR
     SELECT CASE Mid(entero, b, 1)
       CASE "1"
        IF Mid(entero, b + 1, 1) = "0" AND Mid(entero, b + 2, 1) = "0" THEN
          expresion = expresion & "cien "
        ELSE
          expresion = expresion & "ciento "
        END IF
       CASE "2"
        expresion = expresion & "doscientos "
       CASE "3"
        expresion = expresion & "trescientos "
       CASE "4"
        expresion = expresion & "cuatrocientos "
       CASE "5"
        expresion = expresion & "quinientos "
       CASE "6"
        expresion = expresion & "seiscientos "
       CASE "7"
        expresion = expresion & "setecientos "
       CASE "8"
        expresion = expresion & "ochocientos "
       CASE "9"
        expresion = expresion & "novecientos "
     END SELECT

   CASE 2, 5, 8
    SELECT CASE Mid(entero, b, 1)
      CASE "1"
        IF Mid(entero, b + 1, 1) = "0" THEN
           flag = "S"
           expresion = expresion & "diez "
        END IF
        IF Mid(entero, b + 1, 1) = "1" THEN
           flag = "S"
           expresion = expresion & "once "
        END IF
        IF Mid(entero, b + 1, 1) = "2" THEN
           flag = "S"
           expresion = expresion & "doce "
        END IF
        IF Mid(entero, b + 1, 1) = "3" THEN
           flag = "S"
           expresion = expresion & "trece "
        END IF
        IF Mid(entero, b + 1, 1) = "4" THEN
           flag = "S"
           expresion = expresion & "catorce "
        END IF
        IF Mid(entero, b + 1, 1) = "5" THEN
           flag = "S"
           expresion = expresion & "quince "
        END IF
        IF Mid(entero, b + 1, 1) > "5" THEN
           flag = "N"
           expresion = expresion & "dieci"
        END IF
       CASE "2"
        IF Mid(entero, b + 1, 1) = "0" THEN
           expresion = expresion & "veinte "
           flag = "S"
        ELSE
           expresion = expresion & "veinti"
           flag = "N"
                                           KENNY
TRABAJO DE GAMBAS                      12/11/09   KENNY LOOR
        END IF

      CASE "3"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "treinta "
         flag = "S"
       ELSE
         expresion = expresion & "treinta y "
         flag = "N"
       END IF

      CASE "4"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "cuarenta "
         flag = "S"
       ELSE
         expresion = expresion & "cuarenta y "
         flag = "N"
       END IF

      CASE "5"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "cincuenta "
         flag = "S"
       ELSE
         expresion = expresion & "cincuenta y "
         flag = "N"
       END IF

      CASE "6"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "sesenta "
         flag = "S"
       ELSE
         expresion = expresion & "sesenta y "
         flag = "N"
       END IF

      CASE "7"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "setenta "
         flag = "S"
       ELSE
         expresion = expresion & "setenta y "
         flag = "N"
       END IF

      CASE "8"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "ochenta "
         flag = "S"
       ELSE
         expresion = expresion & "ochenta y "
         flag = "N"
       END IF

      CASE "9"
       IF Mid(entero, b + 1, 1) = "0" THEN
         expresion = expresion & "noventa "
         flag = "S"
       ELSE
         expresion = expresion & "noventa y "
         flag = "N"
                                          KENNY
TRABAJO DE GAMBAS                            12/11/09                             KENNY LOOR
            END IF
         END SELECT

        CASE 1, 4, 7
          SELECT CASE Mid(entero, b, 1)
             CASE "1"
               IF flag = "N" THEN
                  IF paso = 1 THEN
                     expresion = expresion & "uno "
                  ELSE
                     expresion = expresion & "un "
                  END IF
               END IF
             CASE "2"
               IF flag = "N" THEN
                  expresion = expresion & "dos "
               END IF
             CASE "3"
               IF flag = "N" THEN
                  expresion = expresion & "tres "
               END IF
             CASE "4"
               IF flag = "N" THEN
                  expresion = expresion & "cuatro "
               END IF
             CASE "5"
               IF flag = "N" THEN
                  expresion = expresion & "cinco "
               END IF
             CASE "6"
               IF flag = "N" THEN
                  expresion = expresion & "seis "
               END IF
             CASE "7"
               IF flag = "N" THEN
                  expresion = expresion & "siete "
               END IF
             CASE "8"
               IF flag = "N" THEN
                  expresion = expresion & "ocho "
               END IF
             CASE "9"
               IF flag = "N" THEN
                  expresion = expresion & "nueve "
               END IF
          END SELECT
        END SELECT
        IF paso = 4 THEN
          IF Mid(entero, 6, 1) <> "0" OR Mid(entero, 5, 1) <> "0" OR Mid(entero, 4, 1) <> "0" OR (Mid(entero,
6, 1) = "0" AND Mid(entero, 5, 1) = "0" AND Mid(entero, 4, 1) = "0" AND Len(entero) <= 6) THEN
             expresion = expresion & "mil "
          END IF
        END IF
        IF paso = 7 THEN
          IF Len(entero) = 7 AND Mid(entero, 1, 1) = "1" THEN
             expresion = expresion & "millón "
          ELSE
             expresion = expresion & "millones "
          END IF
        END IF
      NEXT

    IF deci <> "" THEN
                                                 KENNY
TRABAJO DE GAMBAS                           12/11/09                 KENNY LOOR
      IF Mid(entero, 1, 1) = "-" THEN
         expresion = "menos " & expresion & "con " & deci & "/100"
      ELSE
         expresion = expresion & "con " & deci & "/100"
      END IF
    ELSE
      IF Mid(entero, 1, 1) = "-" THEN
         expresion = "menos " & expresion
      ELSE
         expresion = expresion
      END IF
    END IF
  ELSE
    expresion = ""
  END IF
  TextBox2.Text = expresion
END FUNCTION

PUBLIC SUB Button1_Click()
EnLetras(TextBox1.text)
END

PUBLIC SUB Button2_Click()
 ME.Close
END

PUBLIC SUB Button3_Click()
 TextBox1.Text = ""
 TextBox2.Text = ""
END




                                               KENNY
TRABAJO DE GAMBAS                       12/11/09                       KENNY LOOR
                                     EJERCICIO 21
“FACTURA”
PUBLIC r AS Integer
PUBLIC i AS Integer
PUBLIC m AS Integer
PUBLIC SUB Form_Open()
TextBox6.SetFocus
'Número de columnas
cuadro.Columns.Count = 5
'Número de filas
cuadro.Rows.Count = 10
cuadro.Columns[0].width = 50
cuadro.Columns[1].width = 200
cuadro.Columns[2].width = 80
cuadro.Columns[3].width = 50
cuadro.Columns[4].width = 80
cuadro[0, 0].text = "NUM"
cuadro[0, 1].text = "DETALLE"
cuadro[0, 2].text = "PRECIO.U"
cuadro[0, 3].text = "CANT"
cuadro[0, 4].text = "TOTAL A PAGAR"
r=0
i=0
END
PUBLIC SUB TextBox3_KeyPress()
 IF Key.code = 65293 THEN
  IF TextBox3.text = "" THEN
     Message.Info("Ingrese Valor")
     TextBox3.SetFocus
  ELSE
   i=i+1
   r=r+1
   TextBox4.text = i
   cuadro[r, 0].text = Val(TextBox4.text)
   cuadro[r, 1].text = (TextBox1.text)
   cuadro[r, 2].text = TextBox2.text
   cuadro[r, 3].text = TextBox3.text
   'PRECIO TOTAL
   TextBox5.Text = (TextBox2.text) * (TextBox3.text)
   cuadro[r, 4].text = Val(TextBox5.text)
   m = m + TextBox5.Text
   TextBox1.text = ""
   TextBox2.text = ""
   TextBox3.text = ""
   TextBox1.SetFocus
 ENDIF
 ENDIF
END
PUBLIC SUB Button2_Click()
 TextBox6.Text = m
 TextBox7.Text = (m * 7) / 100
 TextBox8.Text = (((TextBox6.Text) - (TextBox7.Text) * 12) / 100)
 TextBox9.Text = (TextBox6.Text) - (TextBox7.Text) + (TextBox8.Text)
END
PUBLIC SUB TextBox2_KeyPress()
 IF Key.code = 65293 THEN
  IF TextBox2.text = "" THEN
                                           KENNY
TRABAJO DE GAMBAS                        12/11/09      KENNY LOOR
     Message.Info("Ingrese Precio Unitario")
     TextBox2.SetFocus
     ELSE
    TextBox3.Text.SetFocus
  ENDIF
  ENDIF
END
PUBLIC SUB TextBox1_KeyPress()
 IF Key.code = 65293 THEN
  IF TextBox1.text = "" THEN
     Message.Info("Ingrese Detalle")
    TextBox1.SetFocus
     ELSE
    TextBox2.Text.SetFocus
     ENDIF
  ENDIF
END
PUBLIC SUB Button1_Click()
 TextBox4.text = ""
 TextBox5.text = ""
 TextBox6.text = ""
 TextBox7.text = ""
 TextBox8.text = ""
 TextBox9.text = ""
END
PUBLIC SUB Button3_Click()
 ME.Close
END




                                               KENNY
TRABAJO DE GAMBAS                    12/11/09                 KENNY LOOR

RELOJ DIGITAL
' Gambas class file
PUBLIC SUB Form_Open()
timer1.Enabled = TRUE
END
PUBLIC SUB Timer1_Timer()
timer1.Delay = 1000
TextLabel1.Text = Time(Hour(Now), Minute(Now), Second(Now))
END
PUBLIC SUB Button1_Click()
Message.Info("Es facil programar en Gambas")
ME.CLOSE
END
PUBLIC SUB Button2_Click()
  Message.Delete("Ejemplo de Reloj Digital ")
END
PUBLIC SUB Form_Activate()
  TextLabel1.Text = Time(Hour(Now))
END




                                        KENNY

Mais conteúdo relacionado

Mais procurados (15)

Gambas
Gambas Gambas
Gambas
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Ejemplo En Gamabas
Ejemplo En GamabasEjemplo En Gamabas
Ejemplo En Gamabas
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
 
Ejercicios En Gambas
Ejercicios En GambasEjercicios En Gambas
Ejercicios En Gambas
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Docimp
DocimpDocimp
Docimp
 
Fb cheatsheet12b
Fb cheatsheet12bFb cheatsheet12b
Fb cheatsheet12b
 
Pop3ck sh
Pop3ck shPop3ck sh
Pop3ck sh
 
Debug like a doctor
Debug like a doctorDebug like a doctor
Debug like a doctor
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order form
 
Ejerciciosdeprogramacion
EjerciciosdeprogramacionEjerciciosdeprogramacion
Ejerciciosdeprogramacion
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
 

Semelhante a Codigo Fuente De Ejercicios De Gambas

Programas Gambas
Programas GambasProgramas Gambas
Programas GambasRZYMJ
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subirguest9da3a3
 
Yolygambas
YolygambasYolygambas
Yolygambasrosyp
 
ejercicio en Gambas
ejercicio en Gambasejercicio en Gambas
ejercicio en Gambaschino5404
 
1. Determine the output displayed when the button is clicked.P.docx
1. Determine the output displayed when the button is clicked.P.docx1. Determine the output displayed when the button is clicked.P.docx
1. Determine the output displayed when the button is clicked.P.docxjackiewalcutt
 
Updated Visual Basic 6 for beginners.pptx
Updated Visual Basic 6 for beginners.pptxUpdated Visual Basic 6 for beginners.pptx
Updated Visual Basic 6 for beginners.pptxSarveshDeodhar
 
1582627
15826271582627
1582627tabish
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAPsapdocs. info
 
1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docxcorbing9ttj
 
1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docxcorbing9ttj
 
Visual Basic
Visual BasicVisual Basic
Visual BasicVj NiroSh
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAPsapdocs. info
 
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
BOXPLOT EXAMPLES in R And  An Example for BEESWARM:BOXPLOT EXAMPLES in R And  An Example for BEESWARM:
BOXPLOT EXAMPLES in R And An Example for BEESWARM:Dr. Volkan OBAN
 
Rumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanRumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanT. Astari
 

Semelhante a Codigo Fuente De Ejercicios De Gambas (20)

Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Programacion
ProgramacionProgramacion
Programacion
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Dfsi1
Dfsi1Dfsi1
Dfsi1
 
ejercicio en Gambas
ejercicio en Gambasejercicio en Gambas
ejercicio en Gambas
 
Area de un triangulo
Area de un trianguloArea de un triangulo
Area de un triangulo
 
1. Determine the output displayed when the button is clicked.P.docx
1. Determine the output displayed when the button is clicked.P.docx1. Determine the output displayed when the button is clicked.P.docx
1. Determine the output displayed when the button is clicked.P.docx
 
Updated Visual Basic 6 for beginners.pptx
Updated Visual Basic 6 for beginners.pptxUpdated Visual Basic 6 for beginners.pptx
Updated Visual Basic 6 for beginners.pptx
 
1582627
15826271582627
1582627
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx1. Determine the output displayed when the button is clicked.Priva.docx
1. Determine the output displayed when the button is clicked.Priva.docx
 
1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx1. Determine the output displayed when the button is clicked. Priv.docx
1. Determine the output displayed when the button is clicked. Priv.docx
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
Ict project pdf
Ict project pdfIct project pdf
Ict project pdf
 
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
BOXPLOT EXAMPLES in R And  An Example for BEESWARM:BOXPLOT EXAMPLES in R And  An Example for BEESWARM:
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
 
Rumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanRumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai Persamaan
 

Mais de mikyken

Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambasmikyken
 
Reflexion Kenny
Reflexion    KennyReflexion    Kenny
Reflexion Kennymikyken
 
Las Tics
Las TicsLas Tics
Las Ticsmikyken
 
LAS TICS
LAS TICSLAS TICS
LAS TICSmikyken
 
Firma Digital Comercio Electronico
Firma Digital Comercio ElectronicoFirma Digital Comercio Electronico
Firma Digital Comercio Electronicomikyken
 
Impresoras Segun Su Tipo
Impresoras Segun Su TipoImpresoras Segun Su Tipo
Impresoras Segun Su Tipomikyken
 
Resumen de N{umeros Decimales
Resumen de N{umeros DecimalesResumen de N{umeros Decimales
Resumen de N{umeros Decimalesmikyken
 
Trabajo Mañana Internet
Trabajo  Mañana  InternetTrabajo  Mañana  Internet
Trabajo Mañana Internetmikyken
 
Resumen De Clase...!!
Resumen De Clase...!!Resumen De Clase...!!
Resumen De Clase...!!mikyken
 
Sistemas Numeros
Sistemas NumerosSistemas Numeros
Sistemas Numerosmikyken
 

Mais de mikyken (10)

Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 
Reflexion Kenny
Reflexion    KennyReflexion    Kenny
Reflexion Kenny
 
Las Tics
Las TicsLas Tics
Las Tics
 
LAS TICS
LAS TICSLAS TICS
LAS TICS
 
Firma Digital Comercio Electronico
Firma Digital Comercio ElectronicoFirma Digital Comercio Electronico
Firma Digital Comercio Electronico
 
Impresoras Segun Su Tipo
Impresoras Segun Su TipoImpresoras Segun Su Tipo
Impresoras Segun Su Tipo
 
Resumen de N{umeros Decimales
Resumen de N{umeros DecimalesResumen de N{umeros Decimales
Resumen de N{umeros Decimales
 
Trabajo Mañana Internet
Trabajo  Mañana  InternetTrabajo  Mañana  Internet
Trabajo Mañana Internet
 
Resumen De Clase...!!
Resumen De Clase...!!Resumen De Clase...!!
Resumen De Clase...!!
 
Sistemas Numeros
Sistemas NumerosSistemas Numeros
Sistemas Numeros
 

Último

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 

Último (20)

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 

Codigo Fuente De Ejercicios De Gambas

  • 1. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR CODIGO FUENTE DE GAMBAS CRONOMETRO ' Gambas class file PUBLIC SUB Timer1_Timer() SEG.Text = Val(SEG.Text) + 1 IF SEG.Text = 60 THEN MIN.Text = Val(MIN.Text) + 1 SEG.Text = 0 ENDIF IF MIN.Text = 60 THEN HOR.Text = Val(HOR.Text) + 1 MIN.Text = 0 ENDIF IF HOR.Text = 24 THEN HOR.Text = 0 ENDIF END PUBLIC SUB Button1_Click() IF Button1.Text = "INICIAR" THEN Timer1.Enabled = TRUE Button1.Caption = "PARAR" ELSE IF Button1.Text = "PARAR" THEN Timer1.Enabled = FALSE Button1.Caption = "INICIAR" ENDIF ENDIF END PUBLIC SUB Button2_Click() FMain.Show CRONOMETRO1.Hide END MAYOR DE 3 ‘entre 3 números averiguar cuál es el mayor ‘el menor y el intermedio. PUBLIC SUB Main() DIM A, B, C AS Integer A= 6 B = 10 C = 80 IF A > B AND A > C THEN PRINT "MAYOR ES..: " & A KENNY
  • 2. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR IF C > B THEN PRINT "INTERMEDIO ES..: " & C PRINT "MENOR ES..: " & B ELSE PRINT "INTERMEDIO ES..: " & B PRINT "MENOR ES..: " & C ENDIF ELSE IF B > C THEN PRINT "MAYOR ES..: " & B IF A > C THEN PRINT "INTERMEDIO ES..: " & A PRINT "MENOR ES..: " & C ELSE PRINT "INTERMEDIO ES..: " & C PRINT "MENOR ES..: " & A ENDIF ELSE PRINT "MAYOR ES..: " & C IF A > B THEN PRINT "INTERMEDIO ES..: " & A PRINT "MENOR ES..: " & B ELSE PRINT "INTERMEDIO ES..: " & B PRINT "MENOR ES..: " & A ENDIF ENDIF ENDIF END KENNY
  • 3. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR KENNY
  • 4. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR DIGITO AUTOVERIFICADOR PUBLIC SUB Main() DIM B, C, D, E, F, G, H, I, J, K, W AS Integer DIM A AS String PRINT "INGRESE EL NUMERO DE CEDULA" INPUT A FOR B = 1 TO 9 STEP 1 C = Str(Mid(A, B, 1)) D = B MOD 2 IF D = 0 THEN I=I+C ELSE H=C*2 IF H > 9 THEN D = H MOD 10 E = Int(h / 10) F=D+E ELSE F=H ENDIF G=G+F ENDIF NEXT J=G+I K = J MOD 10 W = 10 - K PRINT "EL NUMERO VERIFICADOR DE LA CEDULA ES : " PRINT W END KENNY
  • 5. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR EXPORTACION 'El Ecuador exporta cafe, cacao y maíz en qq, se desea calcular el total de las exportaciones 'y el porcentaje de cada producto exportado, con los siguientes datos 'MAIZ 300, CAFE 400, CACAO 800 PUBLIC SUB Main() DIM A AS Integer DIM B AS Integer DIM C AS Integer DIM S AS Integer DIM P1 AS Float DIM P2 AS Float DIM P3 AS Float A = 300 B = 400 C = 800 S=A+B+ C P1 = A * 100 / S P2 = B * 100 / S P3 = C * 100 / S PRINT "El Total de las exportaciones es..: " & S PRINT "El porcentaje de MAIZ es..: " & P1 & "%" PRINT "El porcentaje de CAFE es..: " & P2 & "%" PRINT "El porcentaje de CACAO es..: " & P3 & "%" END FUNCIONES KENNY
  • 6. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR 'PROCEDIMIENTO PRINCIPAL PUBLIC SUB Main() DIM a, b, h, z AS Integer PRINT "Ingrese un número.:" INPUT a PRINT "Ingrese un número.:" INPUT b pintamedia(a, b) h = 30 z = 70 pintamedia(h, z) END 'PROCEDIMIENTO 1 PUBLIC SUB pintamedia(v1 AS Integer, v2 AS Integer) AS Integer DIM s AS Integer s = v1 + v2 PRINT "La suma es..: ", s END KENNY
  • 7. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR PINTAMEDIA PUBLIC SUB Main() DIM a, b AS Integer PRINT "Ingrese un número.:" INPUT a PRINT "Ingrese un número.:" INPUT b 'Llamada a función suma, resta, multiplicación y división PRINT "La suma es..: ", suma(a, b) PRINT "La resta es..: ", resta(a, b) PRINT "La multiplicación es..: ", multiplicacion(a, b) PRINT "La división es..: ", division(a, b) END 'Función suma PUBLIC SUB suma(v1 AS Integer, v2 AS Integer) AS Integer DIM s AS Integer s = v1 + v2 RETURN s END 'Función resta PUBLIC SUB resta(v1 AS Integer, v2 AS Integer) AS Integer DIM r AS Integer r = v1 - v2 RETURN r END 'Función multiplicación PUBLIC SUB multiplicacion(v1 AS Integer, v2 AS Integer) AS Integer DIM m AS Integer m = v1 * v2 RETURN m END 'Función división PUBLIC SUB division(v1 AS Integer, v2 AS Integer) AS Integer DIM d AS Integer d = v1 / v2 RETURN d E KENNY
  • 8. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR MODULO FIBONACCI PUBLIC SUB Main() 'Serie de Fibonacci DIM p, s, x, t AS Integer DIM fibo AS String p=0 s=1 fibo = Str(p) & " " & Str(s) WHILE x < 5 t=p+s fibo = fibo & " " & Str(t) p=s s=t x=x+1 WEND PRINT fibo END OBJETO SUPERHEROE KENNY
  • 9. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR PRIVATE Heroe1 AS NEW SUPERHEROE PRIVATE Heroe2 AS NEW SUPERHEROE PUBLIC SUB Main() Heroe1.Nombre = "Superman" Heroe1.Actor = "Ramón Zambrano" Heroe1.Habilidad = "Volar" Heroe1.Imprime() WITH Heroe2 .Nombre = "Batman" .Actor = "Ochoa" .Habilidad = "Visión Nocturna" .Imprime END WITH END OBJETO SERES VIVOS INHERITS SeresVivos KENNY
  • 10. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR PRIVATE Nombre AS String PRIVATE Apellido AS String PUBLIC SUB PoneNombre(cadena AS String) Nombre = cadena END PUBLIC SUB PoneApellido(cadena AS String) Apellido = cadena END PUBLIC FUNCTION Nombrecompleto() AS String RETURN Nombre & " " & Apellido END KENNY
  • 11. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR OBJETO VEHICULO PRIVATE marca AS String PRIVATE modelo AS Integer PRIVATE precio AS Integer PRIVATE color AS String PRIVATE placa AS String PUBLIC SUB mar(marca1 AS String) marca = marca1 END PUBLIC SUB model(fecha AS String) modelo = fecha END PUBLIC SUB pre(valor AS Integer) precio = valor END PUBLIC SUB col(tinte AS String) color = tinte END PUBLIC SUB pla(codigo AS String) placa = codigo END PUBLIC FUNCTION marcaauto() AS String RETURN marca END PUBLIC FUNCTION modeloauto() AS String RETURN modelo END PUBLIC FUNCTION precioauto() AS Integer RETURN precio END PUBLIC FUNCTION colorauto() AS String RETURN color END PUBLIC FUNCTION placaauto() AS String RETURN placa END OP ER KENNY
  • 12. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR ACIONES BÁSICAS PUBLIC SUB Button1_Click() suma.text = Val(num1.text) + Val(num2.text) resta.text = num1.text - num2.text multi.text = num1.text * num2.text divi.text = num1.text / num2.text END PUBLIC SUB Button2_Click() num1.text = "" num2.text = "" suma.text = "" resta.text = "" multi.text = "" divi.text = "" END PUBLIC SUB Button3_Click() ME.Close END KENNY
  • 13. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR VENTANA PUBLIC SUB Main() DIM vent AS window vent = NEW window vent.show() END MENU PUBLIC SUB Timer1_Timer() segundos.text = Val(segundos.Text) + 1 IF segundos.text = 59 THEN minutos.text = Val(minutos.text) + 1 segundos.text = "0" segundos.text = Val(segundos.text) + 1 ELSE IF minutos.text = 59 THEN horas.text = Val(horas.text) + 1 minutos.text = "0" ENDIF ENDIF END PUBLIC SUB Button1_Click() IF Button1.text = "Iniciar" THEN Timer1.enabled = TRUE Button1.caption = "Parar" ELSE Timer1.Enabled = FALSE Button1.text = "Iniciar" ENDIF END KENNY
  • 14. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR PUBLIC SUB Button2_Click() segundos.text = "0" minutos.text = "0" horas.text = "0" END JUEGO PUBLIC SUB Button1_Click() DIM n1, n2, n3 AS Integer RANDOMIZE n1 = Int(Rnd() * 10) n2 = Int(Rnd() * 10) n3 = Int(Rnd() * 10) TextBox1.Text = n1 TextBox2.Text = n2 TextBox3.Text = n3 IF n1 = n2 AND n1 = n3 THEN Message("GANASTES") TextBox5.Text = TextBox4.Text * 2 ELSE IF n1 = 7 AND n2 = 7 AND n3 = 7 THEN Message("CONGRATULATIONS GANASTES EL PREMIO MAYOR") TextBox5.Text = TextBox4.Text * 4 ENDIF ENDIF END PUBLIC SUB Button2_Click() ME.Close END KENNY
  • 15. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR GRÁFICOS PUBLIC r AS Integer PUBLIC posy AS Integer PUBLIC posx AS Integer PUBLIC al AS Integer PUBLIC ba AS Integer PUBLIC SUB Form_Open() r = 20 END PUBLIC SUB Button1_Click() posy = area1.Height / 2 posx = area1.Width / 2 Draw.Begin(area1) Draw.FillColor = Color.RGB(128, 255, 0) Draw.FillStyle = Fill.Solid Draw.Circle(posx, posy, r) r = r + 20 'Draw.Ellipse(200, 200, 100, 50) Draw.End END PUBLIC SUB Button3_Click() ME.Close END PUBLIC SUB Button2_Click() area1.Clear posy = area1.Height / 2 posx = area1.Width / 2 Draw.Begin(area1) Draw.FillColor = Color.RGB(128, 255, 0) KENNY
  • 16. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR Draw.FillStyle = Fill.Solid Draw.Circle(posx, posy, r) r = r - 20 'Draw.Ellipse(200, 200, 100, 50) Draw.End END PUBLIC SUB Button4_Click() area1.Clear Draw.Begin(area1) posy = area1.Height / 2 posx = area1.Width / 2 Draw.FillColor = Color.RGB(255, 223, 117) Draw.FillStyle = Fill.Solid Draw.Rect(posx, posy, al, ba) Draw.End al = al + 10 ba = ba + 10 END PROTECTOR DE PANTALLA PUBLIC C1 AS Integer PUBLIC C2 AS Integer PUBLIC C AS Integer PUBLIC r AS Integer PUBLIC SUB Button1_Click() IF Button1.Text = "Iniciar Fondo" THEN Timer1.Enabled = TRUE Button1.Caption = "Parar" ELSE Timer1.Enabled = FALSE Button1.Text = "Iniciar Fondo" ENDIF END PUBLIC SUB Button2_Click() ME.Close END PUBLIC SUB Timer1_Timer() C1 = Int(Rnd() * 700) C2 = Int(Rnd() * 700) C = Int(Rnd() * 15) Draw.Begin(area1) Draw.FillColor = Color.RGB((160 + c1), (2 + c2), (c1 + C2)) ' coge los colores que se designen Draw.FillStyle = Fill.Solid Draw.Circle(C1, C2, C) Draw.End END KENNY
  • 17. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR CALCULADORA PUBLIC BAN AS Integer PUBLIC OP1 AS Float PUBLIC OP2 AS Float PUBLIC SUB Button10_Click() visor.text = visor.Text & "0" END PUBLIC SUB Button11_Click() visor.text = visor.Text & "." END PUBLIC SUB Button7_Click() visor.text = visor.Text & "1" END PUBLIC SUB Button8_Click() visor.text = visor.Text & "2" END PUBLIC SUB Button9_Click() visor.text = visor.Text & "3" END PUBLIC SUB Button4_Click() visor.text = visor.Text & "4" END PUBLIC SUB Button5_Click() visor.text = visor.Text & "5" END PUBLIC SUB Button6_Click() visor.text = visor.Text & "6" END PUBLIC SUB Button1_Click() visor.text = visor.Text & "7" KENNY
  • 18. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR END PUBLIC SUB Button2_Click() visor.text = visor.Text & "8" END PUBLIC SUB Button3_Click() visor.text = visor.Text & "9" END PUBLIC SUB Button12_Click() ME.Close END PUBLIC SUB Button16_Click() visor.text = "" END PUBLIC FUNCTION operacion(v1 AS Float, v2 AS Float, opera AS Integer) AS Float DIM re AS Float SELECT CASE opera CASE 1 re = v1 + v2 CASE 2 re = v1 - v2 CASE 3 re = v1 * v2 CASE 4 re = v1 / v2 CASE 5 re = (v1 * v2) / 100 CASE 6 re = v1 ^ 2 CASE 7 re = v1 ^ 3 CASE 8 re = v1 ^ v2 CASE 9 re = 1 / v1 END SELECT RETURN re END PUBLIC SUB Button13_Click() BAN = 1 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear END PUBLIC SUB Button14_Click() BAN = 2 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear END PUBLIC SUB Button18_Click() BAN = 3 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear KENNY
  • 19. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR END PUBLIC SUB Button17_Click() BAN = 4 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear END PUBLIC SUB Button15_Click() IF visor.text <> 0 THEN OP2 = visor.Text ELSE OP2 = 0 ENDIF visor.Text = operacion(OP1, OP2, BAN) END PUBLIC SUB Button19_Click() BAN = 5 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear END PUBLIC SUB Button20_Click() BAN = 6 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.text = OP1 END PUBLIC SUB Button21_Click() DIM valor, x1, x2, i AS Integer DIM cadena, cadena2 AS String valor = visor.Text WHILE valor > 0 x1 = valor MOD 2 x2 = Int(valor / 2) cadena = cadena & Str(x1) valor = x2 WEND FOR i = Len(cadena) TO 1 STEP -1 cadena2 = cadena2 & (Mid(cadena, i, 1)) NEXT visor.text = cadena2 END PUBLIC SUB Button22_Click() DIM valor, x1, x2, i AS Integer DIM cadena, cadena2 AS String valor = visor.Text WHILE valor > 0 x1 = valor MOD 8 x2 = Int(valor / 8) cadena = cadena & Str(x1) valor = x2 WEND FOR i = Len(cadena) TO 1 STEP -1 cadena2 = cadena2 & (Mid(cadena, i, 1)) KENNY
  • 20. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR NEXT visor.text = cadena2 END PUBLIC SUB Button23_Click() DIM valor, x1, x2, i AS Integer DIM cadena, cadena2 AS String valor = visor.Text WHILE valor > 0 x1 = valor MOD 16 x2 = Int(valor / 16) IF x1 = 10 THEN cadena = cadena & "A" ELSE IF x1 = 11 THEN cadena = cadena & "B" ELSE IF x1 = 12 THEN cadena = cadena & "C" ELSE IF x1 = 13 THEN cadena = cadena & "D" ELSE IF x1 = 14 THEN cadena = cadena & "E" ELSE IF x1 = 15 THEN cadena = cadena & "F" ELSE cadena = cadena & Str(x1) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF valor = x2 WEND FOR i = Len(cadena) TO 1 STEP -1 cadena2 = cadena2 & (Mid(cadena, i, 1)) NEXT visor.Text = cadena2 END PUBLIC SUB Button24_Click() BAN = 7 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.text = OP1 END PUBLIC SUB Button27_Click() BAN = 8 IF visor.text <> 0 THEN OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.Clear END PUBLIC SUB Button25_Click() BAN = 9 IF visor.text <> 0 THEN KENNY
  • 21. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR OP1 = visor.Text ELSE OP1 = 0 ENDIF visor.text = OP1 END PUBLIC SUB Button26_Click() DIM a, b AS Long DIM valor AS Integer valor = visor.Text b=1 FOR a = valor TO 1 STEP -1 b=b*a NEXT visor.Text = b END PUBLIC SUB Button28_Click() DIM r AS Float r = Rad(visor.text) visor.text = Sin(r) END PUBLIC SUB Button29_Click() DIM r AS Float r = Rad(visor.text) visor.text = Cos(r) END PUBLIC SUB Button30_Click() DIM r AS Float r = Rad(visor.text) visor.text = Tan(r) END CONVIERTE NÚMERO A LETRAS PUBLIC FUNCTION EnLetras(numero AS String) AS String DIM b, paso AS Integer DIM expresion, entero, deci, flag AS String flag = "N" FOR paso = 1 TO Len(numero) IF Mid(numero, paso, 1) = "." THEN flag = "S" ELSE IF flag = "N" THEN entero = entero & Mid(numero, paso, 1) ELSE deci = deci & Mid(numero, paso, 1) END IF END IF NEXT IF Len(deci) = 1 THEN deci = deci & "0" END IF flag = "N" IF Val(numero) >= -999999999 AND Val(numero) <= 999999999 THEN FOR paso = Len(entero) TO 1 STEP -1 b = Len(entero) - (paso - 1) SELECT CASE paso CASE 3, 6, 9 KENNY
  • 22. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR SELECT CASE Mid(entero, b, 1) CASE "1" IF Mid(entero, b + 1, 1) = "0" AND Mid(entero, b + 2, 1) = "0" THEN expresion = expresion & "cien " ELSE expresion = expresion & "ciento " END IF CASE "2" expresion = expresion & "doscientos " CASE "3" expresion = expresion & "trescientos " CASE "4" expresion = expresion & "cuatrocientos " CASE "5" expresion = expresion & "quinientos " CASE "6" expresion = expresion & "seiscientos " CASE "7" expresion = expresion & "setecientos " CASE "8" expresion = expresion & "ochocientos " CASE "9" expresion = expresion & "novecientos " END SELECT CASE 2, 5, 8 SELECT CASE Mid(entero, b, 1) CASE "1" IF Mid(entero, b + 1, 1) = "0" THEN flag = "S" expresion = expresion & "diez " END IF IF Mid(entero, b + 1, 1) = "1" THEN flag = "S" expresion = expresion & "once " END IF IF Mid(entero, b + 1, 1) = "2" THEN flag = "S" expresion = expresion & "doce " END IF IF Mid(entero, b + 1, 1) = "3" THEN flag = "S" expresion = expresion & "trece " END IF IF Mid(entero, b + 1, 1) = "4" THEN flag = "S" expresion = expresion & "catorce " END IF IF Mid(entero, b + 1, 1) = "5" THEN flag = "S" expresion = expresion & "quince " END IF IF Mid(entero, b + 1, 1) > "5" THEN flag = "N" expresion = expresion & "dieci" END IF CASE "2" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "veinte " flag = "S" ELSE expresion = expresion & "veinti" flag = "N" KENNY
  • 23. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR END IF CASE "3" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "treinta " flag = "S" ELSE expresion = expresion & "treinta y " flag = "N" END IF CASE "4" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "cuarenta " flag = "S" ELSE expresion = expresion & "cuarenta y " flag = "N" END IF CASE "5" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "cincuenta " flag = "S" ELSE expresion = expresion & "cincuenta y " flag = "N" END IF CASE "6" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "sesenta " flag = "S" ELSE expresion = expresion & "sesenta y " flag = "N" END IF CASE "7" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "setenta " flag = "S" ELSE expresion = expresion & "setenta y " flag = "N" END IF CASE "8" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "ochenta " flag = "S" ELSE expresion = expresion & "ochenta y " flag = "N" END IF CASE "9" IF Mid(entero, b + 1, 1) = "0" THEN expresion = expresion & "noventa " flag = "S" ELSE expresion = expresion & "noventa y " flag = "N" KENNY
  • 24. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR END IF END SELECT CASE 1, 4, 7 SELECT CASE Mid(entero, b, 1) CASE "1" IF flag = "N" THEN IF paso = 1 THEN expresion = expresion & "uno " ELSE expresion = expresion & "un " END IF END IF CASE "2" IF flag = "N" THEN expresion = expresion & "dos " END IF CASE "3" IF flag = "N" THEN expresion = expresion & "tres " END IF CASE "4" IF flag = "N" THEN expresion = expresion & "cuatro " END IF CASE "5" IF flag = "N" THEN expresion = expresion & "cinco " END IF CASE "6" IF flag = "N" THEN expresion = expresion & "seis " END IF CASE "7" IF flag = "N" THEN expresion = expresion & "siete " END IF CASE "8" IF flag = "N" THEN expresion = expresion & "ocho " END IF CASE "9" IF flag = "N" THEN expresion = expresion & "nueve " END IF END SELECT END SELECT IF paso = 4 THEN IF Mid(entero, 6, 1) <> "0" OR Mid(entero, 5, 1) <> "0" OR Mid(entero, 4, 1) <> "0" OR (Mid(entero, 6, 1) = "0" AND Mid(entero, 5, 1) = "0" AND Mid(entero, 4, 1) = "0" AND Len(entero) <= 6) THEN expresion = expresion & "mil " END IF END IF IF paso = 7 THEN IF Len(entero) = 7 AND Mid(entero, 1, 1) = "1" THEN expresion = expresion & "millón " ELSE expresion = expresion & "millones " END IF END IF NEXT IF deci <> "" THEN KENNY
  • 25. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR IF Mid(entero, 1, 1) = "-" THEN expresion = "menos " & expresion & "con " & deci & "/100" ELSE expresion = expresion & "con " & deci & "/100" END IF ELSE IF Mid(entero, 1, 1) = "-" THEN expresion = "menos " & expresion ELSE expresion = expresion END IF END IF ELSE expresion = "" END IF TextBox2.Text = expresion END FUNCTION PUBLIC SUB Button1_Click() EnLetras(TextBox1.text) END PUBLIC SUB Button2_Click() ME.Close END PUBLIC SUB Button3_Click() TextBox1.Text = "" TextBox2.Text = "" END KENNY
  • 26. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR EJERCICIO 21 “FACTURA” PUBLIC r AS Integer PUBLIC i AS Integer PUBLIC m AS Integer PUBLIC SUB Form_Open() TextBox6.SetFocus 'Número de columnas cuadro.Columns.Count = 5 'Número de filas cuadro.Rows.Count = 10 cuadro.Columns[0].width = 50 cuadro.Columns[1].width = 200 cuadro.Columns[2].width = 80 cuadro.Columns[3].width = 50 cuadro.Columns[4].width = 80 cuadro[0, 0].text = "NUM" cuadro[0, 1].text = "DETALLE" cuadro[0, 2].text = "PRECIO.U" cuadro[0, 3].text = "CANT" cuadro[0, 4].text = "TOTAL A PAGAR" r=0 i=0 END PUBLIC SUB TextBox3_KeyPress() IF Key.code = 65293 THEN IF TextBox3.text = "" THEN Message.Info("Ingrese Valor") TextBox3.SetFocus ELSE i=i+1 r=r+1 TextBox4.text = i cuadro[r, 0].text = Val(TextBox4.text) cuadro[r, 1].text = (TextBox1.text) cuadro[r, 2].text = TextBox2.text cuadro[r, 3].text = TextBox3.text 'PRECIO TOTAL TextBox5.Text = (TextBox2.text) * (TextBox3.text) cuadro[r, 4].text = Val(TextBox5.text) m = m + TextBox5.Text TextBox1.text = "" TextBox2.text = "" TextBox3.text = "" TextBox1.SetFocus ENDIF ENDIF END PUBLIC SUB Button2_Click() TextBox6.Text = m TextBox7.Text = (m * 7) / 100 TextBox8.Text = (((TextBox6.Text) - (TextBox7.Text) * 12) / 100) TextBox9.Text = (TextBox6.Text) - (TextBox7.Text) + (TextBox8.Text) END PUBLIC SUB TextBox2_KeyPress() IF Key.code = 65293 THEN IF TextBox2.text = "" THEN KENNY
  • 27. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR Message.Info("Ingrese Precio Unitario") TextBox2.SetFocus ELSE TextBox3.Text.SetFocus ENDIF ENDIF END PUBLIC SUB TextBox1_KeyPress() IF Key.code = 65293 THEN IF TextBox1.text = "" THEN Message.Info("Ingrese Detalle") TextBox1.SetFocus ELSE TextBox2.Text.SetFocus ENDIF ENDIF END PUBLIC SUB Button1_Click() TextBox4.text = "" TextBox5.text = "" TextBox6.text = "" TextBox7.text = "" TextBox8.text = "" TextBox9.text = "" END PUBLIC SUB Button3_Click() ME.Close END KENNY
  • 28. TRABAJO DE GAMBAS 12/11/09 KENNY LOOR RELOJ DIGITAL ' Gambas class file PUBLIC SUB Form_Open() timer1.Enabled = TRUE END PUBLIC SUB Timer1_Timer() timer1.Delay = 1000 TextLabel1.Text = Time(Hour(Now), Minute(Now), Second(Now)) END PUBLIC SUB Button1_Click() Message.Info("Es facil programar en Gambas") ME.CLOSE END PUBLIC SUB Button2_Click() Message.Delete("Ejemplo de Reloj Digital ") END PUBLIC SUB Form_Activate() TextLabel1.Text = Time(Hour(Now)) END KENNY