This course provides students with the basic ability needed to write programs in an imperative language of procedural nature (e.g., C), with particular emphasis on the relationship between the programming 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 debugging 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.
• 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.
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 writing simple programs to the computer, in lab.
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 with no significant syntactical errors.