Programming I and Laboratory F - NModule Programming I
Academic Year 2023/2024 - Teacher: GIOVANNI MARIA FARINELLAExpected 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 made of 20 questions 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" result if the student achieves 15 correct answers and a "not admitted" result otherwise).
2. Practical laboratory test. It is a small project to be carried out in the classroom on the computer. The test is deemed insufficient if the code has compilation errors, runtime 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
Lectures and presentation of schemes and algorithms.
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
Author | Title | Publisher | Year | ISBN |
---|---|---|---|---|
Paul J. Deitel - Harvey M. Deitel | Il linguaggio C Fondamenti e tecniche di programmazione | Pearson | 2022 | 9788891906236 |
Course Planning
Subjects | Text References | |
---|---|---|
1 | Introduction to programming | textbook, any material provided by the teacher |
2 | The C language | textbook, any material provided by the teacher |
3 | Constructs of the C language | textbook, any material provided by the teacher |
4 | File management in C | textbook, any material provided by the teacher |
5 | First data structures | textbook, any material provided by the teacher |
6 | Sorting and search algorithms | textbook, any material provided by the teacher |
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:
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.
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.
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, as per the calendar.
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.