Programming I [Matricole dispari] (2019/2020)

Course code
Nicola Bombieri
Academic sector
Language of instruction
Teaching is organised as follows:
Activity Credits Period Academic staff Timetable
Teoria 8 II semestre, I semestre Nicola Bombieri

Go to lesson schedule

Laboratorio 4 II semestre, I semestre Maurizio Boscaini

Go to lesson schedule

Learning outcomes

This course provides students with the basic ability needed to write programs in an imperative lan- guage of procedural nature (e.g., C), with particular emphasis on the relationship between the pro- gramming language and the underlying hardware machine, on the concept of recursion, and on the implementation of simple data structures, both recursive and non-recursive. At the end of the course, the student will have to demonstrate to own knowledge and comprehension ability on the concepts at the basis of programming through an imperative language of procedural nature; organization ability, implementation and translation on that language, and analysis through de bugging of algorithms and of the corresponding data structures starting from specifications; to be able to develop know-how necessary to continue the study autonomously in the field of programming and Software development.


• Introduction.
• Fundamental concepts: programming, high-level languages, operating systems, program compiling.
• Compiling and execution of the first program: first program compiling, first program execution, first program description, variable visualization, comments.
• Variables, data types and arithmetic expressions: operating with variables, data types and constants, operating with arithmetic expressions, combining operations with assignment – assignment operators.
• Iteration: for instruction, while instruction, do instruction.
• Taking decisions: if instruction, switch instruction, Boolean variables, conditional statement.
• Statements with arrays: array definition, array initialization, arrays of chars, multidimensional arrays.
• Functions: function definition, arguments and local variables, returning results of a function, functions that call functions that calling functions…, top-down programming, functions and arrays, global variables, automatic and static variables, recursive functions.
• Structures: a structure for data storing, functions and structures, structure initialization, array of structures, structures containing structures, structures containing arrays, variants of structures.
• Strings of chars: arrays of chars, strings of chars of variable length, escape sequences, other information of constant strings, char strings, structures and arrays, operations with chars.
• Pointers: pointer definition, using pointers in expressions, pointers and structures, pointers and functions, pointers and arrays, operations on pointers, pointers and memory addresses.
• The preprocessing: #define directive, #include directive, conditional compiling.
• Input/Output operations: I/O of chars – getchar and putchar, printf and scanf
• Advanced characteristics: comma operator, dynamic memory allocation.

• Introduction, file system, bash, editor.
• Practical programming in lab by applying all the arguments explained in the theory part: examples, exercises.
• Code debugging: gdb, ddd, and CodeBlocks.

Assessment methods and criteria

The exam, unified with the Laboratory module, consists in two parts, that will take place around February (first part) and June (second part). The final global mark will be the composition (average) of the marks of the two parts. Students who do not pass these partial exams can try again in the normal 4 examinations scattered around the year, starting from June. Those exams are on the total program of the course.
The exams (partial as well as total) verify the ability in coding simple programs to the computer or a written exam.
To pass the exam, the students have to show:
- they have understood the principles related to the programming in C language
- they are able to develop C code and to analyze its correctness and problems through debugging
- they are able to apply the acquired knowledge to implement algorithms in C code by starting from specifications given as exercises.
The emphasis in the evaluation will be given to the ability to organize algorithms and data structures and to translate them into the C language.

Reference books
Activity Author Title Publisher Year ISBN Note
Teoria Stephen G. Kochan Programmare in C (Edizione 3) Pearson 2011 9788871926605