SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
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
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
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
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
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
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
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
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

Contenu connexe

Dernier

EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
FagnerLisboa3
 
Modulo-Mini Cargador.................pdf
Modulo-Mini Cargador.................pdfModulo-Mini Cargador.................pdf
Modulo-Mini Cargador.................pdf
AnnimoUno1
 

Dernier (11)

Avances tecnológicos del siglo XXI 10-07 eyvana
Avances tecnológicos del siglo XXI 10-07 eyvanaAvances tecnológicos del siglo XXI 10-07 eyvana
Avances tecnológicos del siglo XXI 10-07 eyvana
 
Refrigerador_Inverter_Samsung_Curso_y_Manual_de_Servicio_Español.pdf
Refrigerador_Inverter_Samsung_Curso_y_Manual_de_Servicio_Español.pdfRefrigerador_Inverter_Samsung_Curso_y_Manual_de_Servicio_Español.pdf
Refrigerador_Inverter_Samsung_Curso_y_Manual_de_Servicio_Español.pdf
 
EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial UninoveEPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
 
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptxPROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
 
How to use Redis with MuleSoft. A quick start presentation.
How to use Redis with MuleSoft. A quick start presentation.How to use Redis with MuleSoft. A quick start presentation.
How to use Redis with MuleSoft. A quick start presentation.
 
Innovaciones tecnologicas en el siglo 21
Innovaciones tecnologicas en el siglo 21Innovaciones tecnologicas en el siglo 21
Innovaciones tecnologicas en el siglo 21
 
Modulo-Mini Cargador.................pdf
Modulo-Mini Cargador.................pdfModulo-Mini Cargador.................pdf
Modulo-Mini Cargador.................pdf
 
pruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNITpruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNIT
 
Avances tecnológicos del siglo XXI y ejemplos de estos
Avances tecnológicos del siglo XXI y ejemplos de estosAvances tecnológicos del siglo XXI y ejemplos de estos
Avances tecnológicos del siglo XXI y ejemplos de estos
 
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptxEL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
 
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
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