1 / 217

CS-361: Estructuras de Control Primera Clase

CS-361: Estructuras de Control Primera Clase. Dr. Jesús Borrego Lead Faculty, COS Regis University. Temas. Instructor Introducción y Guía del curso Tarea de la primera noche Capítulos 1-2 Actividad 1 Capítulo 3 (pp.117-148) Instalación de DevC++ Ejemplo de programas Tarea #1.

Télécharger la présentation

CS-361: Estructuras de Control Primera Clase

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. CS-361: Estructuras de ControlPrimera Clase Dr. Jesús Borrego Lead Faculty, COS Regis University

  2. Temas Instructor Introducción y Guía del curso Tarea de la primera noche Capítulos 1-2 Actividad 1 Capítulo 3 (pp.117-148) Instalación de DevC++ Ejemplo de programas Tarea #1

  3. Instructor • Dr. Jesús Borrego • Educación • PhD MIS; MS CS; BS CS; BS EE • Ubicado: • Colorado Springs • Casado, 5 hijos • Maestro desde 1989, a nivel de Asociado, Licenciado y Maestría • En Regis U. desde 1995

  4. Introducción • Prerequisitos • CS 208 • Experiencia en programación no es necesaria • Acceso a computadora personal • Compilador Dev C++/Code::Blocks • Pueden usar otros a su propio riesgo

  5. Guía de curso Se obtiene de la página del curso: http://academic.regis.edu/jborrego Trata sobre los conceptos básicos de la organización informática. Desarrolla una metodología precisa y lógica en la reducción de datos complejos y sin formato en formato algorítmico. Presenta los conceptos y metodologías de programación estructurada y el diseño.

  6. Guía de curso II Demuestra los usos, abusos, y las mejores prácticas de las estructuras de control. Usamos los conceptos del lenguaje C++ para ilustrar los conceptos. Se recomienda DevC++ (“open source”). Se puede usar otro compilador (no se recomienda).

  7. Materiales de instrucción • Libro de texto • Malik, D.S. (2011). C++ Programming: From Problem Analysis to Program Design (5a edición). Boston, MA: Course Technology/Cengage Learning; ISBN-10: 0-538-79808-4; ISBN-13: 978-0-538-79808-2. • Compilador C++ • Por la página del curso • http://academic.regis.edu/mlotfy/CS208/Computer_fundamentals_classroom.htm#Supplemental • Dev C++ or Code::Blocks

  8. Sobrevista del curso Páginas 14-15

  9. Método de evaluación Participación 15% Tarea primera noche 5% Tareas en clase 30% Tareas (6 programas) 30% Exámenes (2) 20%

  10. Estándar de código Será revisados Descripción completa en la página del curso Comentarios se requieren Indentar apropiadamente Espacio en blanco (espacios, líneas en blanco, indentación) Constantes globales en vez de valores en el código ApellidoNombre_PgmX.cpp

  11. Documentación de los programas Documento requerido Siempre en español Primera página en APA Siguientes páginas sin formato APA En Microsoft Word Descripción del problema Descripción del algoritmo usado 10% del grado del programa ApellidoNombre_PgmX.doc

  12. Acerca de sus compañeros: Nombre Carrera que cursan Donde trabajan Donde viven Experiencia en programación ¿Que esperan de el curso?

  13. Instalación del compilador Se obtiene de la página del curso Guarden a su ordenador Ejecuten la aplicación y mantenga las opciones recomendadas No cambien opciones a menos que sepan lo que estan haciendo Revisen la instalación

  14. Instrucciones de descarga

  15. Instrucciones de descarga(II)

  16. Configuración del compilador

  17. Verificación del ambiente

  18. Configuración de el editor

  19. Vocabulario Clave Compiler – compilador Hard coded variable – valor usado en vez de constante I/O stream – flujo de entradas y salidas Linker – enlazador Object code – código objeto Server – ordenador, servidor, estación de trabajo Source code – código fuente Syntax and semantics – sintaxis y semántica Whitespace – líneas en blanco, espacio, indentar

  20. Tarea de la primera noche Leer las páginas 1 a 148 y el apéndice E páginas 1248 y 1249 del texto. Escoja una actividad que usted hace diariamente, como las que están escrita arriba, y escriba un algoritmo especifico, claro y preciso para la misma, en Español. Si es necesario, enumere los diferentes pasos a seguir.

  21. Algoritmo ‘una descripción precisa de un método para resolver un problemaparticular con las operaciones o acciones de un repertorio bien entendido. Algoritmos están en todas partes. Cuando cambiamos los neumáticos de un auto, cortar el césped, aspirar la alfombra, o seguir las instrucciones a un restaurante, se utiliza algoritmo. Una persona puede resolver los problemas por medio de algoritmos expresados en inglés, siempre y cuando la persona entienda inglés. Y una computadora puede resolver problemas por medio de algoritmos expresados en un lenguaje de programación, siempre que el ordenador "entienda" el lenguaje.’ [De John Shore, The Sachertorte Algorithm, 1985]

  22. ¿Para que usamos algoritmos? • Programas = Algoritmos + Estructuras de datos (Niklaus Wirth) • Experimentaremos con algoritmos y control de datos en estaclase • La próximaclase (CS 362) cubreestructuras de datos • Antes de escribir un programa, necesitamosuna idea de como resolver el problema • Estorequiere un algoritmo

  23. Capítulo 1 23-78

  24. C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages

  25. Objectives In this chapter, you will: • Learn about different types of computers • Explore the hardware and software components of a computer system • Learn about the language of a computer • Learn about the evolution of programming languages • Examine high-level programming languages

  26. Objectives (cont'd.) • Discover what a compiler is and what it does • Examine a C++ program • Explore how a C++ program is processed • Learn what an algorithm is and explore problem-solving techniques • Become aware of structured design and object-oriented design programming methodologies • Become aware of Standard C++ and ANSI/ISO Standard C++

  27. Introduction • Without software, the computer is useless • Software developed with programming languages • C++ is a programming language • C++ suited for a wide variety of programming tasks • Before programming, it is useful to understand terminology and computer components

  28. A Brief Overview of the History of Computers • Early calculation devices • Abacus, Pascaline • Leibniz device • Babbage machines: difference and analytic engines • Hollerith machine

  29. A Brief Overview of the History of Computers (cont'd.) • Early computer-like machines • Mark I • ENIAC • Von Neumann architecture • UNIVAC • Transistors and microprocessors

  30. A Brief Overview of the History of Computers (cont'd.) • Categories of computers • Mainframe computers • Midsize computers • Micro computers (personal computers)

  31. Elements of a Computer System Hardware CPU Main memory Secondary storage Input/Output devices Software

  32. Hardware CPU Main memory: RAM Input/output devices Secondary storage

  33. Central Processing Unit and Main Memory • Central processing unit • Brain of the computer • Most expensive piece of hardware • Carries out arithmetic and logical operations

  34. Central Processing Unit and Main Memory (cont'd.)

  35. Central Processing Unit and Main Memory (cont'd.) Random access memory Directly connected to the CPU All programs must be loaded into main memory before they can be executed All data must be brought into main memory before it can be manipulated When computer power is turned off, everything in main memory is lost

  36. Secondary Storage • Secondary storage: device that stores information permanently • Examples of secondary storage: • Hard disks • Flash drives • Floppy disks • Zip disks • CD-ROMs • Tapes

  37. Input/Output Devices • Input devices feed data and programs into computers • Keyboard • Mouse • Secondary storage • Output devices display results • Monitor • Printer • Secondary storage

  38. Software • Software: programs that do specific tasks • System programs take control of the computer, such as an operating system • Application programs perform a specific task • Word processors • Spreadsheets • Games

  39. The Language of a Computer • Digital signals: sequences of 0s and 1s • Machine language: language of a computer • Binary digit (bit): • The digit 0 or 1 • Binary code: • A sequence of 0s and 1s • Byte: • A sequence of eight bits

  40. The Language of a Computer (cont’d.)

  41. The Language of a Computer (cont'd.) • ASCII (American Standard Code for Information Interchange) • 128 characters • A is encoded as 1000001 (66th character) • 3 is encoded as 0110011

  42. The Language of a Computer (cont'd.) • EBCDIC • Used by IBM • 256 characters • Unicode • 65536 characters • Two bytes are needed to store a character

  43. The Evolution of Programming Languages • Early computers were programmed in machine language • To calculate wages = rates * hours in machine language: 100100 010001 //Load 100110 010010 //Multiply 100010 010011 //Store

  44. The Evolution of Programming Languages (cont'd.) • Assembly language instructions are mnemonic • Assembler: translates a program written in assembly language into machine language

  45. The Evolution of Programming Languages (cont'd.) • Using assembly language instructions, wages = rates • hours can be written as: LOAD rate MULT hour STOR wages

  46. The Evolution of Programming Languages (cont'd.) • High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java • Compiler: translates a program written in a high-level language machine language • The equation wages = rate • hours can be written in C++ as: wages = rate * hours;

  47. Processing a C++ Program #include <iostream> using namespace std; int main() { cout << "My first C++ program." << endl; return 0; } Sample Run: My first C++ program.

  48. Processing a C++ Program (cont'd.) • To execute a C++ program: • Use an editor to create a source program in C++ • Preprocessor directives begin with # and are processed by a the preprocessor • Use the compiler to: • Check that the program obeys the rules • Translate into machine language (object program)

  49. Processing a C++ Program (cont'd.) • To execute a C++ program (cont'd.): • Linker: • Combines object program with other programs provided by the SDK to create executable code • Loader: • Loads executable program into main memory • The last step is to execute the program

  50. Processing a C++ Program (cont'd.)

More Related