Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Estructuras de Control y Repetición
1. Estructuras de
Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Estructuras de Control Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Roberto Carlos Abreu D´
ıaz
January 20, 2010
2. Estructuras de
Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Estructuras de Selecci´n
o Selecci´n
o
Sentencia if
Sentencia if Sentencia switch
Sentencia switch Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Estructuras de Repetici´n
o
Sentencia for
Sentencia while
3. Estructuras de
Estructuras de Selecci´n
o Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Escogen el camino a seguir en base a una condici´n
o
booleana
Si est´ lloviendo salgo con con paraguas
a
Si tengo lo suficiente me compro una pizza
Si b 2 − 4ac > 0 entonces la ecuaci´n tiene soluciones
o
reales
4. Estructuras de
Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Se puede anidar
Para incluir m´s de una sentencia se utilizan sentencias
a
compuestas
5. Estructuras de
Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
6. Estructuras de
Estructuras de Repetici´n
o Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Repiten una acci´n mientras cierta condici´n se
o o
mantenga verdadera
Usualmente la acci´n var´ ligeramente de cada
o ıa
repetici´n a la otra
o
7. Estructuras de
Sentencia for Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Se utiliza generalmente cuando se necesita iterar por un
rango de valores
8. Estructuras de
Sentencia while Control
Roberto Carlos
Abreu D´ıaz
Outline
Estructuras de
Selecci´n
o
Sentencia if
Sentencia switch
Estructuras de
Repetici´n
o
Sentencia for
Sentencia while
Se puede pensar en ´l como un if repetido n veces
e