Programming I and Laboratory F - N
Module Laboratory

Academic Year 2022/2023 - Teacher: ANTONINO FURNARI

Expected Learning Outcomes

Knowledge and understanding: the primary objective of the course is the acquisition by students of the "philosophy" of structured programming, and the detailed knowledge of the syntax and semantics of the C programming language. The course pays particular attention to the development of well-written and well-structured code using the basic techniques for software development. 


Applying knowledge and understanding: we intend to provide the tools to achieve the following practical and professional skills:

  • Translating algorithmic ideas into code;

  • Designing, describing and implementing C programs;

  • Knowing how to use tools for debugging C programs;

  • Understanding and analysing third-party C code also in terms of efficiency;

  • Correctly referencing the documentation.

Making judgments: through the examination of numerous code examples and a substantial practical component that involves carrying out computer exercises, the learner will be able to analyse problems and design and implement related software solutions.

Communication skills: the student will acquire the necessary communication skills in the use of verbal / technical language in computer programming.

Learning skills: the course aims to provide the learner with the necessary theoretical and practical methodologies to be used in professional contexts and, in particular, the ability to formulate ad-hoc algorithms for solving new problems and the possibility of easily and quickly acquiring another programming language.

EXAM DATES

All exam dates are published on the website www.dmi.unict.it

IN ITINERE TESTS

There will be in itinere tests. Passing all the ongoing tests is equivalent to passing the theoretical test (1).

END OF COURSE TESTS

1. Theoretical test. This is a multiple choice test designed to verify the understanding of the basic elements of programming and the main characteristics of the C language. The test is not assigned a mark out of thirty (the test will receive an "admitted" or "not admitted" result).

2. Practical laboratory test. It is a series of exercises or a small project to be carried out in the classroom on the computer. The proof is deemed insufficient if the product code has compilation errors or if it does not produce an output compatible with the assignments of the task. A grade out of thirty will be assigned to the test.

3. Oral exam: a discussion on the test carried out on the computer, questions on the theoretical topics included in the program. The test allows to increase or decrease the grade obtained in test 2) (usually by a maximum of 3 points). If test 3) highlights the lack of basic competences, the student will have to repeat the three tests.

Learning assessment may also be carried out on line, should the conditions require it.

Course Structure

Classroom lessons with live coding.

Required Prerequisites

Attendance and passing of the final test of the computer science “corsi zero”.

Attendance of Lessons

Attending the lectures is not mandatory but strongly recommended.

Detailed Course Content

Introduction to programming

  • Problems; Algorithms; Flowcharts.

  • Types of information and their digital representation: booleans, integers, floats, strings, multimedia data. IEEE standard.

  • Outline of von Neumann's computational model: memory + processing unit.

  • Variables; Expressions; Assignments.

  • Programming languages: machine, assembly and high level.

  • Translation problem: compilation and interpretation.

  • Structured linear notation. Böhm-Jacopini theorem.

 The C language

  • Installation of the compiler;

  • First program: Editing, Compiling, Running, Debugging.

  • Constructs of the language.

  • Types of data; Predefined operators; Type conversions.

  • Basic I / O management: stdin, stdout, stderr.

  • Execution of commands as expression evaluation.

  • Flow control:

  • if-then-else;

  • switch;

  • while;

  • do-while;

  • for;

  • break, continue;

  • First examples of functions on atomic data, productive and non-productive functions,

  • Scope of variables.

  • Explicit memory management: motivations, techniques and basic functions.

  • Pointers: motivations and management. Address and dereferencing operators.

  • Arithmetic of pointers. Pointers and Arrays. Pointers as a function parameter. Dynamic memory allocation. The const modifier.

  • Arrays in C: introduction and exercises on creating, managing, accessing, modifying, and controlling the elements of an array. Multidimensional arrays.

  • Strings in C: introduction and exercises on creating, managing, accessing, modifying, and controlling the elements of a string.

  • Generation of pseudo-random numbers in C.

  • Functions on non-atomic data and how to pass parameters to a function. Inline functions. Function call management via activation stack. Composition of functions. 

  • Recursion: Via examples; Activation record; Recursion stack.

  • I Records (struct), unions, and enum.

  • Arguments to the main function.

 Files.

  • Functions on files: fopen, fclose, fseek, ftell, fread, fwrite

 First data structures

  • Implementation of a set through sorted array and unordered array.

  • Stacks and queues. Formal description and implementations.

  • Linked lists: simple, double. Formal description and implementations.

Sorting and search algorithms

(formal definition and examples of implementation with arrays and lists)

  • Selection Sort, Insertion sort and Bubble Sort

  • Sequential search and dichotomous search

Textbook Information

Il linguaggio C Fondamenti e tecniche di programmazione • 9/Ed. Paul J. Deitel - Harvey M. Deitel. ISBN: 9788891906236


AuthorTitlePublisherYearISBN
Paul J. Deitel - Harvey M. DeitelIl linguaggio C Fondamenti e tecniche di programmazionePearson20229788891906236

Course Planning

 SubjectsText References
1Introduction to programmingmaterial possibly provided by the teacher, textbook
2The C languagematerial possibly provided by the teacher, textbook
3Constructs of the C languagematerial possibly provided by the teacher, textbook
4File management in Cmaterial possibly provided by the teacher, textbook
5First data structuresmaterial possibly provided by the teacher, textbook
6Sorting and search algorithmsmaterial possibly provided by the teacher, textbook

Learning Assessment

Learning Assessment Procedures

The exam consists in verifying the objectives of the course, namely:

  • the ability to describe and implement simple algorithmic procedures.

  • knowledge of the C programming language

  • the ability to design and code programs efficiently

To this end, the exam consists of three tests designed to verify the previous points. The exam will be passed when all three tests are evaluated as sufficient:

  1. Theoretical test: a multiple choice test designed to verify the understanding of the basic elements of programming and the main characteristics of the C language. This test will be carried out with IT tools in order to give immediate feedback to the student and allow them to access the practical test laboratory.

  2. Practical laboratory test: a series of exercises or a small project that the student will have to carry out independently on the computer in the classroom. This test is inseparable from the test in point 1 and must be held on the same day as test 1.

  3. Oral: a discussion on the test carried out on the computer, questions on the theoretical topics included in the program.

Tests 1), 2) and 3) are sequential, therefore, all those who have passed test 1) can access test 2), and all those who have passed test 2) can access test 3). Tests 1) and 2) must be taken on the same date. Test 3) can be passed in a different session than that of tests 1) and 2); the sufficiency achieved in tests 1) and 2) will be considered valid for the entire A.Y. (until December following the delivery of the course). No mark is assigned to test 1), while to test 2) a mark out of thirty is assigned. Test 3) allows to increase or decrease the grade obtained in test 2) (usually by a maximum of 3 points). If test 3) highlights obvious shortcomings, the student will have to repeat the three tests. Tests 1) and 2) will be held on the official dates of the exams, while test 3) will be held on a date subsequent to that of the official exam, as per the calendar.

Examples of frequently asked questions and / or exercises

Sample questions for the oral exam:

  • Memory management in C (types of memory and constructs to access them). Types of allocation

  • Types of data: what they are used for, differences between types, memory occupied. Type conversions

  • Variables and their visibility. Constants. #define directive.

  • Input / output management in C.

  • File management in C.

  • Structured programming, main control structures and their uses.

  • Utility and definition of arrays. Considerations on the representation of arrays in memory. Array indexing. Relation to pointers.

  • Usefulness and definition of pointers. Syntax and main advantages over non-pointer variables. Uses of pointers for passing parameters to function by reference.

  • Strings: definition and their usefulness. Main operations on strings.