Programming I and Laboratory F - N
Module Laboratory

Academic Year 2024/2025 - 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. Further information on the exams will be given through Microsoft Teams (Team code: yqk2vtp).

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


Teaching material distributed through Microsoft Teams (Team code: yqk2vtp).


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

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.

  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). The three tests can be passed in different sessions; 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). If test 2) is failed, test 1) needs to be repeated. 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.

Exam Booking and Registration

Students who wish to take any of the three tests (multiple-choice test, lab, or oral exam) in a given session must register for that session through the student portal. 


Failure to register will result in the inability to take the test, even if part of the exam was taken in previous sessions. 

Those who take all three tests in the same session will see a single exam registration with the overall result of the exam after taking the oral exam. 


Those who take only some of the three tests (e.g., only the multiple-choice test or the multiple-choice test + lab, or only the lab because the multiple-choice test was taken in a previous session) will see a recording with the result "RITIRATO" after the date of the oral exam. The intermediate results of the tests will still be saved, and it will be possible to register for another session to take the remaining tests. 


Those who register but do not attend any of the three tests scheduled for that session will see a recording with the result "ASSENTE".  


Those who attend the lab without withdrawing and do not pass it, as well as those who do not pass the oral exam, will see a recording with the result "NON APPROVATO."


Students with disabilities and/or DSA must contact the teacher, the CInAP representative of the DMI (Prof. Daniele) and CInAP well in advance of the exam date to communicate that they intend to take the exam using the appropriate compensatory measures.


Communication of results

The results of the tests and announcements with useful information for the exams will be communicated via Microsoft Teams (Team code: yqk2vtp).

Grading

The grading is expressed in thirtieths according to the following scheme:


Grade 29-30 with honors

The student has a deep understanding of fundamental concepts and major programming techniques. They can promptly analyze programming problems, identifying suitable algorithms and programming techniques for problem-solving independently and critically. They have excellent communication skills and language proficiency.

Grade 26-28

The student has a good understanding of fundamental concepts and major programming techniques. They can analyze programming problems, identifying appropriate algorithms and programming techniques for problem-solving. They have good communication skills and language proficiency.


Grade 22-25

The student has a fair understanding of fundamental concepts and major programming techniques. They can analyze programming problems, although not always exhaustively, identifying suitable algorithms and programming techniques for problem-solving. They have moderate communication skills and language proficiency.


Grade 18-21

The student has minimal knowledge of fundamental concepts and major programming techniques. They have modest ability to analyze programming problems and identify suitable algorithms and programming techniques for problem-solving. They have sufficient communication skills, although not always appropriate language proficiency.


Failed Exam

The student lacks the minimum required knowledge of the main course contents. Their ability to use the specific language is very poor or nonexistent, and they are unable to apply the acquired knowledge independently.

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.