SlideShare a Scribd company logo
1 of 13
COLEGIO NACIONAL TECNICO 
“ARTURO BORJA”
INTEGRANTES
• GLENDA HURTADO
• DAVID SALDAÑA
EJERCICIOS DE “GAMBAS”
EJERCICIO
“SUMA”
PUBLIC SUB Main()
`Mi primera suma
DIM AAS Integer
DIM B AS Integer
DIM S AS Integer
A = 10
B = 20
S = A + B
PRINT "LA SUMA ES...:"
PRINT S
END
EJERCICIO
“MAYOR DE 3 NUMEROS”
‘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
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
EJERCICIO
“DIGITO AUTOVERIFICADOR”
PUBLIC SUB Main()
DIM B, C, D, E, F, G, H, I, J, K, W AS Integer
DIM AAS 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
EJERCICIO
“FUNCIONES”
'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
EJERCICIO
“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
END
EJERCICIO
“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
EJERCICIO
“OPERACIONES 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
EJERCICIO
“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
EJERCICIO
“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"
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
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))
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
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

More Related Content

What's hot

Ejercicios En Gambas
Ejercicios En GambasEjercicios En Gambas
Ejercicios En Gambasmafermen7
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambaseduann
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambasmikyken
 
Ejemplo En Gamabas
Ejemplo En GamabasEjemplo En Gamabas
Ejemplo En Gamabaseduann
 
Ejemplo En Gambas
Ejemplo En GambasEjemplo En Gambas
Ejemplo En Gambaseduann
 
The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184Mahmoud Samir Fayed
 
키보드 키와 기호 이름 알아보기
키보드 키와 기호 이름 알아보기키보드 키와 기호 이름 알아보기
키보드 키와 기호 이름 알아보기Changwon National University
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order formKhairi Aiman
 

What's hot (14)

Ejercicios En Gambas
Ejercicios En GambasEjercicios En Gambas
Ejercicios En Gambas
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 
Ejemplo En Gamabas
Ejemplo En GamabasEjemplo En Gamabas
Ejemplo En Gamabas
 
Ejemplo En Gambas
Ejemplo En GambasEjemplo En Gambas
Ejemplo En Gambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Area de un triangulo
Area de un trianguloArea de un triangulo
Area de un triangulo
 
The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184
 
Vb
VbVb
Vb
 
키보드 키와 기호 이름 알아보기
키보드 키와 기호 이름 알아보기키보드 키와 기호 이름 알아보기
키보드 키와 기호 이름 알아보기
 
Programacion
ProgramacionProgramacion
Programacion
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order form
 

Viewers also liked

Ny green movement
Ny green movementNy green movement
Ny green movementarufer1
 
Keys of solomon,theurgia goetia
Keys of solomon,theurgia goetiaKeys of solomon,theurgia goetia
Keys of solomon,theurgia goetiaTeodora Marola
 
Ny green movement
Ny green movementNy green movement
Ny green movementarufer1
 
El intrigante fenotipo del obeso sano
El intrigante fenotipo del obeso sanoEl intrigante fenotipo del obeso sano
El intrigante fenotipo del obeso sanoYERCIN MAMANI ORTIZ
 
Qanun Aceh No. 8 Tahun 2013 tentang Kepariwisataan
Qanun Aceh No. 8 Tahun 2013 tentang KepariwisataanQanun Aceh No. 8 Tahun 2013 tentang Kepariwisataan
Qanun Aceh No. 8 Tahun 2013 tentang KepariwisataanArlin El-Salury
 
NY Green Movement
NY Green MovementNY Green Movement
NY Green Movementarufer1
 
presentación sobre tres herramientas para elaborar presentaciones
presentación sobre tres herramientas para elaborar presentacionespresentación sobre tres herramientas para elaborar presentaciones
presentación sobre tres herramientas para elaborar presentacionesFranklin Montaguano
 

Viewers also liked (10)

Madam bhikaji cama
Madam bhikaji camaMadam bhikaji cama
Madam bhikaji cama
 
Ny green movement
Ny green movementNy green movement
Ny green movement
 
Keys of solomon,theurgia goetia
Keys of solomon,theurgia goetiaKeys of solomon,theurgia goetia
Keys of solomon,theurgia goetia
 
Ny green movement
Ny green movementNy green movement
Ny green movement
 
El intrigante fenotipo del obeso sano
El intrigante fenotipo del obeso sanoEl intrigante fenotipo del obeso sano
El intrigante fenotipo del obeso sano
 
Vive oferta07 a2014
Vive oferta07 a2014Vive oferta07 a2014
Vive oferta07 a2014
 
Qanun Aceh No. 8 Tahun 2013 tentang Kepariwisataan
Qanun Aceh No. 8 Tahun 2013 tentang KepariwisataanQanun Aceh No. 8 Tahun 2013 tentang Kepariwisataan
Qanun Aceh No. 8 Tahun 2013 tentang Kepariwisataan
 
NY Green Movement
NY Green MovementNY Green Movement
NY Green Movement
 
presentación sobre tres herramientas para elaborar presentaciones
presentación sobre tres herramientas para elaborar presentacionespresentación sobre tres herramientas para elaborar presentaciones
presentación sobre tres herramientas para elaborar presentaciones
 
Capt pawan kumar khatkar
Capt pawan kumar khatkarCapt pawan kumar khatkar
Capt pawan kumar khatkar
 

Similar to Gambas

Similar to Gambas (20)

Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Calculadora
CalculadoraCalculadora
Calculadora
 
ejercicio en Gambas
ejercicio en Gambasejercicio en Gambas
ejercicio en Gambas
 
Dfsi1
Dfsi1Dfsi1
Dfsi1
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
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
 
C programs
C programsC programs
C programs
 
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
 
Docimp
DocimpDocimp
Docimp
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Ejerciciosdeprogramacion
EjerciciosdeprogramacionEjerciciosdeprogramacion
Ejerciciosdeprogramacion
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programming
 
Vb.net programs
Vb.net programsVb.net programs
Vb.net programs
 

Recently uploaded

Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Delhi Call girls
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCamilleBoulbin1
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 

Recently uploaded (20)

Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 

Gambas

  • 1. COLEGIO NACIONAL TECNICO  “ARTURO BORJA” INTEGRANTES • GLENDA HURTADO • DAVID SALDAÑA EJERCICIOS DE “GAMBAS” EJERCICIO “SUMA” PUBLIC SUB Main() `Mi primera suma DIM AAS Integer DIM B AS Integer DIM S AS Integer A = 10 B = 20 S = A + B PRINT "LA SUMA ES...:" PRINT S END EJERCICIO “MAYOR DE 3 NUMEROS” ‘entre 3 números averiguar cuál es el mayor
  • 2. ‘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 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
  • 3. EJERCICIO “DIGITO AUTOVERIFICADOR” PUBLIC SUB Main() DIM B, C, D, E, F, G, H, I, J, K, W AS Integer DIM AAS 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
  • 4. EJERCICIO “FUNCIONES” '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
  • 5. EJERCICIO “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
  • 6. 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 END EJERCICIO “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
  • 7. EJERCICIO “OPERACIONES 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
  • 8. EJERCICIO “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
  • 9. EJERCICIO “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" 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 = ""
  • 10. 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 END PUBLIC SUB Button17_Click() BAN = 4 IF visor.text <> 0 THEN OP1 = visor.Text ELSE
  • 11. 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))
  • 12. 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
  • 13. ENDIF visor.Clear END PUBLIC SUB Button25_Click() BAN = 9 IF visor.text <> 0 THEN 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