Programming fundamentals

Base Knowledge

No recommended basic knowledge.

Teaching Methodologies

The following teaching methodologies are used in this course unit:

1. Expository method: explanatory method where theoretical foundations and concepts are presented by the teacher and discussed with the class. Concepts and information will be presented to students through, for example, slide presentations or oral discussions. It will be used in classes to structure and outline the information.

2. Demonstrative method: based on the example given by the teacher of a technical or practical operation that one wishes to be learned. It focuses on how a given operation is carried out, highlighting the most appropriate techniques, tools and equipment. It will be used, for example, in practical and laboratory classes.

3. Interrogative method: process based on verbal interactions, under the direction of the teacher, adopting the format of questions and answers. It allows for greater dynamics in the classroom and consolidates learning. It will be used, for example, to remember elements of previous classes and in revisions of the lectured content.

4. Active methods: pedagogical techniques will be used in which the student is the center of the learning process, being an active participant and involved in his own training. The teacher assumes the role of facilitator, stimulating critical thinking, collaboration, creativity and student autonomy. They will be applied in classes to achieve a dynamic and more lasting learning environment.

Learning Results

At the end of the course unit, the student will be able to:

1. Classify the different types of programming languages. Analyse their main characteristics. Justify the need for compilers.

2. Define algorithm. Analyse the approaches used to describe algorithms. Construct solutions using flowcharts and pseudo-code.

3. Analyse the main characteristics of a programming language. Explain the standardisation process. Discuss the development cycle and the structure of a program.

4. Discuss the types and formats of variables. Illustrate the creation, initialisation, and modification of variables. Demonstrate the usage of casting between variables.

5. Explain conditional and unconditional flow control. Identify the different types of conditional control structures. Illustrate the application and precedence of logical and relational operators. Create programs that demonstrate the usage of tests and conditions.

6. Identify structures for interactive conditional control. Justify the usage of operators for code optimisation. Identify scenarios and usages for infinite loops. Create programs that demonstrate the usage of loops.

7. Define subprograms. Classify the types of subprograms (procedures and functions). Explain the syntax of a subprogram. Demonstrate the use of multiple files. Create programs that exemplify the functionality and utility of subprograms.

8. Explain the concept of arrays. Analyse how they are created, accessed, and manipulated. Demonstrate how constants can be created. Define String. Discuss how strings are created, accessed, and manipulated. Create programs that make usage of arrays and strings.

9. Define files. Classify the types of files and streams. Analyse the different operations associated with text files. Demonstrate the passing of parameters through the command line. Create programs that read and write to text files.

Program

1. Programming languages. Language types. Low-level languages. High-level languages. Structured languages. Object-oriented languages. Data types, control structures (sequential, selection, repetition). Compilers (gcc) and assemblers.

2. Introduction to algorithms: flowcharts and pseudo-code. Definitions. Declaring variables and assigning values. Arithmetic, relational and logical operators. Conditional branch command. Repeat commands.

3. C programming language. Characteristics. Standardisation. Development cycle: source code, preprocessor, compilation, linking, execution. Structure of a C program: #include, main(), blocks, comments (/* */, //).

4. Data types. Variables: definition, type, nomenclature, declaration, assignment, arithmetic. Integer variables: types (short, long, signed, unsigned), format. Formatted writing and reading functions (printf() and scanf()). Real variables: IEEE 754 standard, types, format. Characters: types, format. Casting: implicit, explicit.

5. Tests and Conditions. Logical Values. Relational Operators (<, <=, >, >=, ==, !=). Logical Operators (!, &&, ||). Operator Precedence. Conditional flow control. if…else statement: indentation, statement blocks, chained statements. Switch statement. Unconditional flow control: break.

6. Cycles. Optimisation: increment/decrement operators (++, –), assignment operators (+=, -=). Iterative conditional flow control: while, for, do…while. Infinite Cycles. Unconditional flow control: continue.

7. Subprograms. Subprograms types: predefined functions (in stdio.h and string.h libraries), user defined. Syntax: return type, name, parameters, body, return. Local variables. Function position: prototype. Multiple Files: header files (.h). Passing parameters by value and by reference.

8. Arrays. Definition. Classification: one-dimensional, multidimensional. Declaration, initialisation and access to elements. Passing arrays to a function. Constants: #define, const. Strings: declaration, initialisation, reading and writing. Functions for manipulating strings.

9. Files. Definition. Stream types: stdin, stdout, stderr. File types: binary, text (EOL: \n, \n\r). Operations in text files: opening, reading, writing, closing. Opening modes: r, w, a, r+, w+, a+, b. EOF macro and end-of-file function (feof()). Passing arguments through the command line (argc(), argv()).

Curricular Unit Teachers

Célia Teresa Ligeiro Mendes Pereira

Grading Methods

Students can get approval in the curricular unit during Periodic Evaluation or Evaluation by Exam.

The Periodic Evaluation consists of:

  • two tests: 75% of the final grade
  • one individual assignments 25% of the final grade.

All evaluation components have a minimum grade of 6 values out of 20.

 

Evaluation by Exam consists of taking an exam in any of the scheduled assessment periods.


    Internship(s)

    NAO

    Bibliography

    Damas, L. (2025). Linguagem C (25th ed.). FCA.

    Gustedt, J. (2019). Modern C. Manning Publications.

    King, K. N. (2008). C Programming: A Modern Approach (2nd ed.). W. W. Norton & Company.

    Perry, G., & Miller, D. (2013). C Programming Absolute Beginner’s Guide (3rd ed.). Que Publishing.

    Rocha, A. (2006). Introdução à programação usando C. FCA.