lecciones de programacion intermediasev3lessons.com › es › programminglessons › intermediate...
TRANSCRIPT
![Page 1: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/1.jpg)
BySanjayandArvindSeshan
LECCIONESDEPROGRAMACIONINTERMEDIAS
VARIABLES
![Page 2: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/2.jpg)
Objetivos1. Conozcalosdiferentestiposdevariables
2. Aprendaaleeryescribirvariables
Prerrequisitos:CablesdeDatos,SensordeColor,BloquePantalla,BloqueEsperar
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 2
![Page 3: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/3.jpg)
Extra:BloquePantalla“Conectado”
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 3
Texto a mostrar Click en el icono para Conectado
Entrada del TextoLimpiar pantalla anteriorColumna de inicioFila de inicioTexto blanco o negroTamaño
0 – Normal1 – Negrita2 – Grande
![Page 4: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/4.jpg)
Variables¿Quéesunavariable?R.- Unavariableguardaunvalorquedespuéspuedeserusadoenelprograma.Míralocomounacajadondeguardascosasparadespuésusarlas.
Puedesponercualquiernombrealavariable
Lostiposdevariablesson:◦ Numérico(guardaunnumero)◦ Lógico(guardaunVerdadero/Falso)◦ Texto(Guardalíneasdetexto“Holamundo”)◦ ArregloNumérico(guardaunaseriedenúmeros…1,2,3,10,55)◦ Arreglológico(Guardaunaseriedevaloreslógicos…Verdadero,Falso,Falso)
Puedenusarseconentradasysalidasasíquepuedenusarsepara….◦ Escribir– Poneunvalorenlavariable◦ Leer– Sacaelultimovalorescritoenlavariable
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 n4
![Page 5: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/5.jpg)
¿PorquéusarVariables?LasvariablessonformasdemoverdatosportodoelprogramasintantosCablesdeDatos.
PuedesusarvariablesparatransferirdatosdentrodeunMiBloquesinnecesidaddeparámetrosdeentrada(ejem.UnavariableparaeltamañodelaruedaenMove-inches – Noseañadeunaentradaporqueraramenteestevalorcambia.Puedesusarlavariableenvarioslugaresysolocambiarlaenunpuntoespecial.)
LasvariablesArreglopuedenguardarymanejarmuchosdatossinnecesidaddetantoscablesdedatos.Puestenermuchasvariablesomuchoscablesdedatospuedecomplicarelprograma
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 5
![Page 6: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/6.jpg)
BloquesdeVariables
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 6
Escribir Numero
Leer Numero
Escribir Lógico
Leer Lógico
Escribir Texto
Escribir (Entradas) apuntan hacia arriba
Leer (Salidas) Apuntan hacia abajo
Numérico Lógico Texto
Elbotóndelaizquierdadeterminaeltipodevariableautilizar
Leer texto
TIP:CuandoelBloqueEV3muestraunvalorlógicoenlapantalla,lohacecon1o0.1esverdaderoy0esFalso
![Page 7: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/7.jpg)
SalidasdelasVariables
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 7
VariableNumérica:Mostraraelnumero10
VariableLógica:Mostrara0enlapantalla
VariabledeTexto:Mostrara“Hello”enlapantalla
Escribaenlavariable
MostraremoselvalordelavariableenlapantalladelBloqueEV3
¿Puedeadivinarquevaloresobtendrá?
![Page 8: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/8.jpg)
DesafíosDesafío1:◦ ConstruyaunprogramaquemuestrecuantasveceshapresionadoelbotónArriba
Desafío2:◦ Construyaunprogramaquemuestrecuantaslíneasnegrashacruzado
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 n8
Inicio
Meta
Desafío2
![Page 9: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/9.jpg)
SoluciónDesafío1:ContadordeClicks
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 n9
Recuerdeinicializarlasvariablesen0aliniciodecadaprograma,estoborraracualquierdatonodeseadoquepuedacontener.
![Page 10: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/10.jpg)
SoluciónDesafío2:Contadordelíneas
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 n10
![Page 11: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/11.jpg)
SiguientesPasosUsaremosVariablesenlassiguientesLecciones:◦ Avanzado:MenuSystem(ConsulteDisponibilidadenEspañol)◦ Avanzado:ParallelBeamSynchronization (ConsulteDisponibilidadenEspañol)
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 11
![Page 12: LECCIONES DE PROGRAMACION INTERMEDIASev3lessons.com › es › ProgrammingLessons › intermediate › ...Texto (Guarda líneas de texto “Hola mundo”) Arreglo Numérico (guarda](https://reader034.vdocuments.mx/reader034/viewer/2022042316/5f04c6fd7e708231d40fa74b/html5/thumbnails/12.jpg)
CréditosEstetutorialfuecreadoporSanjaySeshanyArvindSeshan
Masleccionesdisponiblesenwww.ev3lessons.com
TraducidoporDavidDanielGalvánMedrano
©2015EV3LESSONS.COM,LASTEDIT7/06/2016 12
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.