Introdução à Programação

Base Knowledge

None in particular.

Teaching Methodologies

In the theoretical classes, the theoretical bases of the C language are explained using simple examples, whenever necessary.

In practical classes, problems are presented that students must implement using the C language.

Learning Results

Objectives: to acquire the ability to develop problem solving strategies and to code these strategies in the C programming language.

 

Skills to develop:

  • Simulate step-by-step execution of simple programs;
  • Write programs to solve simple problems (examples: numerical calculation, word processing);
  • Break down problems into sub-tasks that can be implemented as reusable functions;
  • Test and fix errors in programs.

Program

  1. Analysis and problem solving strategies.
  2. Introduction to pseudocode.
  3. Flowcharts.
  4. Structure of a C program.
    1. Preprocessor commands (#include and #define).
    2. Main function.
    3. Helper functions (prototypes).
    4. Comments.
  5. Variables and data types.
  6. Assignment command and arithmetic operators.
  7. Memory layout of a C program and introduction to pointers.
  8. Simple data input and output (getc, scanf, putchar, and printf).
  9. Decision making (if/else, if/else if/else, and switch/case).
    1. Boolean expressions.
    2. Relational operators (==, !=, >, >=, <, <=).
    3. Logical operators (!, &&, &, ||, and |).
  10. Repetition mechanisms.
    1. for loop.
    2. while loop.
    3. do … while loop.
    4. continue and break statements.
  11. Functions.
    1. Structure of functions.
    2. Input parameters.
    3. Passing parameters by value and by reference.
    4. Output parameters.
    5. Local and global variables, and the scope variables.
  12. Arrays.
    1. One-dimensional, two-dimensional and multidimensional arrays.
    2. Strings and functions for string manipulation.
    3. Passing arrays to functions.
    4. Pointers and dynamic memory allocation.
  13. Data structures.
    1. Data type defining (typedef).
    2. Data structures as members of other data structures.
    3. Passing structures to functions (by value and by reference).
  14. Files.
    1. Text files and functions for its manipulation.
    2. Binaries and functions for their manipulation.

Curricular Unit Teachers

Internship(s)

NAO

Bibliography

  • Kernighan, B. W. & Ritchie, D. M. (1988). The C programming language (2nd edition). Englewood Cliffs, N. J. : Prentice Hall.
    Cotas da biblioteca do ISEC: 1A-1-68 (ISEC) – 05389, 1A-1-222 (ISEC) – 07998.
  • Damas, L. (). Linguagem C. FCA – Editora de Informática, Lda..
    Cotas na biblioteca do ISEC: 1A-1-321 (ISEC) – 10344, 1A-1-365 (ISEC) – 11819, 1A-1-366 (ISEC) – 11820, 1A-1-389 (ISEC) – 12100, 1A-1-200 (ISEC) – 15330, 1A-1-456 (ISEC) – 18949.