Programming

Base Knowledge

 

Basic knowledge of programming in C language.

It is recommended that students have passed the Introduction to Programming course.

Teaching Methodologies

 

Theoretical classes: Presentation of new concepts and discussion of examples.

Practical classes: Resolution of practical exercises. Autonomous implementation of C programs.

Learning Results

 

In this course the students learn how to implement complete programs in C. All main features of C are examined in order to give the students a comprehensive knowledge of this programming language. This knowledge is essential to develop programs that are able to solve real-world problems.

The most important topics discussed in this course are file manipulation and dynamic memory management. The students also learn how to develop programs that operate on fundamental data structures, such as queues, heaps, linked lists and binary trees.

Program

 

1. Pointers
1.1. Introduction. Pointers and addresses
1.2. Pointers and functions
1.3. Pointer arithmetic
1.4. Pointer arrays to strings

2. Header files
2.1. Dividing the source code into multiple files
2.2. Using header files

3. Structures
3.1. Definition
3.2. Typedef

3.3. Arrays of structures
3.4. Dynamic allocation of an array

3.5. Unions

3.6. Enumerations

4. Dynamic structures
4.1. Dynamic storage allocation
4.2. Linked lists
4.3. Other dynamic structures

5. Files
5.1. Text files and binary files
5.2. Basic operations: creation, reading and writing

5.3. Other operations: search, modification

5.3. Non-sequential access to files

6. Recursive functions
6.1. Definition

6.2. Writing recursive functions
6.3. Binary trees

Curricular Unit Teachers

Francisco José Baptista Pereira

Grading Methods

There are 3 assessment components:

A. Submission of 4 Exercises During the Semester
Throughout the semester, students will be assigned 4 exercises to implement a function in C. Once the challenge is announced, students will have 48 hours to submit their solution on InforEstudante. Submissions are individual. The evaluation will be fully automated, considering only the behavior of the implemented function in a set of test cases. The exercise dates will be communicated to students in advance and are expected to take place approximately in weeks 4, 7, 10, and 12.
At the end of the semester, students who have submitted the exercises will be required to attend a mandatory in-person defense. During this defense, they must make modifications to their submitted code. The grade for component A will only be valid after completing the defense.

B. Practical Test
During the semester, there will be a 60-minute in-person written test. The test will include multiple-choice questions and C code writing exercises. The test date will be communicated to students in advance and is expected to take place in the middle of the semester.

C. Exam
The exam in the different assessment periods consists of a written test in which students must implement several functions in the C programming language. The exam is worth a minimum of 35% of the test score.

Final Grade Calculation Options

There are 2 options for calculating the final grade:
Option 1: A (4 points) + B (5 points) + C (11 points)
This option is only valid for students who submit the exercises in component A and complete the corresponding defense.

Option 2: B (5 points) + C (15 points)

Examination Periods

Regular Period:
Students who submit the exercises and complete the defense are mandatorily evaluated according to Option 1.
All other students are evaluated according to Option 2.

Supplementary Period:
Students can choose either Option 1 or Option 2.

Special Period:
Students eligible for the special period can choose either Option 1 or Option 2.

Students who are retaking the course to improve their grade are mandatorily evaluated according to Option 2.

 


    Internship(s)

    NAO

    Bibliography

     

    Mandatory

    King, K. N. (2008). C Programming: A Modern Approach, second edition, W. W. Norton & Company. (Cotas 1A-1-351, 1A-1-352)

    Slides of the theoretical classes and support material for the practical classes (Worksheets and code snippets). The material is available at InforEstudante and GitHub.

     

    Complementary

    Bermudez, M. (1998). Study Guide for C Programming: A Modern Approach, W. W. Norton & Company. (Cotas 1A-1-293, 1A-1-91)

    Guerreiro, P. (2006). Elementos de Programação em C, 3ª edição, FCA- Editora de Informática. (Cotas 1A-1-195, 1A-1-430)

    Sedgewick, R. (1999). Algorithms in C: Fundamentals, Data Structures, Sorting, Searching, 3ª edição, Addison-Wesley. (Cota 1A-1-296)