1 / 31

Sub-algoritmos

CONTENIDO. FUNCIONESPROCEDIMIENTOSARGUMENTOSVARIABLES. Funciones. f:{a,b,c} ? {0,1,2} a ? 1 b ? 0 c ? 2. g: Naturales ? Naturales x ? x2. h: Reales x Reales ? Reales (a,b) ? a2 2*b . Funciones en Programac

chaman
Télécharger la présentation

Sub-algoritmos

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. Sub-algoritmos

    3. Funciones f:{a,b,c} ? {0,1,2} a ? 1 b ? 0 c ? 2

    4. Funciones en Programacin En programacin: proceso que recibe valores de entrada y retorna un resultado.

    5. Funciones en Programacin

    15. Funciones Recursivas Funcin que se invoca a s misma. Se debe tener mucho cuidado en su definicin.

    18. Procedimientos Sub-programa que ejecuta una tarea especfica. Tpicamente usados para : imprimir en pantalla, modificar variables, leer datos, etc.

    21. Argumentos por Valor y por Referencia Argumentos por valor: su modificacin no tiene efecto en el resto del programa. Argumentos por referencia: cualquier modificacin del argumento tiene efectos en el resto del programa

    22. Argumentos por Valor y por Referencia Argumento por referencia: se especifica anteponiendo la palabra ref a su definicin. Ejemplo: el argumento A es por referencia y el argumento B es por valor:

    24. ARGUMENTOS POR REFERENCIA

    26. ARGUMENTOS POR REFERENCIA

    27. Variables Locales y Globales Variables Globales: definidas al comienzo del programa, vlidas para toda funcin y/o procedimiento en el programa. Variables Locales: definidas dentro de cada funcin, vlidas solo en la funcin. Regla del buen programador: evitar al mximo el uso de variables globales.

    28. Variables locales y globales

    31. FIN Gracias por la atencin prestada

More Related