COMPUTER SCIENCE AND LABORATORY

Academic Year 2023/2024 - Teacher: Marco RUSSO

Expected Learning Outcomes

The specific objectives of this course are:

  • Teach the basic principles of structured programming through the C language.
  • Understand all the various steps that allow you to move from the problem to be solved or from the phenomenon to be analyzed (and / or simulated) to its implementation via software.
  • Acquire the ability to identify the most satisfactory one in terms of speed / memory among several solutions.    
  • Acquire the ability to correctly analyze experimental data.

Furthermore, with reference to the so-called Dublin Descriptors, this course contributes to acquiring the following software skills:

Knowledge and understanding:

The primary objective of the course is identified in the acquisition by the students of the "philosophy" of structured programming, as well as in 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 C code.

Applying knowledge and understanding:

It is intended to provide students with the following skills:

  1. Translate problems to be solved or phenomena to simulate into code;
  2. Design, describe and implement C programs;
  3. Knowing how to use the basic tools for programming;
  4. Understand and analyze C code also in terms of efficiency;

Autonomy of judgment (making judgments).

Through the examination of numerous code examples and a substantial practical component that involves the development of computer exercises, the learner will be able, both autonomously and cooperatively, to analyze problems, design and implement the related software solutions.

Communication skills.

The student will acquire the necessary communication skills and expressive appropriateness in the use of technical verbal language in the context of computer programming.

Learning skills.

The course aims to provide the learner with the necessary theoretical and practical methodologies to be used in research and professional contexts with particular attention to the physical field.

Course Structure

Lectures and PC exercises.

Should the circumstances require online or blended teaching, appropriate modifications to what is hereby stated may be introduced, in order to achieve the main objectives of the course.

Required Prerequisites

No one in particular

Attendance of Lessons

Attendance to the course is usually compulsory.

Detailed Course Content

The concept of algorithm

The concept of programming

Overview of programming languages

Difference between interpreters and compilers

The organization of memory in a processing system

Overview of the C language

The concept of variable

The sizeof operator

Header files

Stages of compilation

Errors and warnings

Type of C basic data and their modifiers

Constants Enumerations

I / O of a program

Expressions and mathematical functions

Type conversions

Overflow and underflow

Assignment operators

Unary operators

Mathematical functions

Random values

Conditional execution: IF

Logical operators

Conditional execution: SWITCH

Iterative execution: WHILE, FOR and DO-WHILE

Vectors and matrices

Characters and strings

The concept of indentation of the code

Comma operator

Ternary operator

Discussion on the endianess

The system function

Bitwise operators

Text files and binary files

Pointers Distinctions between pointers and vectors

Pointers arithmetic

Functions on byte blocks

The functions in C.

Prototype

Local variables

Parameters and return value

Current and formal parameters

Explicit and implicit parameter switching

The recursion

Data structures

The typedef operator

Introduction to the preprocessor C

Dynamic allocation of memory

Textbook Information

Any C book

Course Planning

 SubjectsText References
1The concept of algorithm.The concept of programming. Notes on programming languages. Difference between interpreters and compilers. The organization of memory in a processing system. C language overviewAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
2The concept of variable. The sizeof operator.Any C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
3Header files. Compilation phases. Errors and warningsAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
4Basic C data types and their modifiers. Constants. Enumerations. I/O of a program. Introduction to the C preprocessor.Any C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
5Mathematical expressions and functions. Overflow and underflow type conversions. Assignment operators. Unary operators mathematical functions.Any C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
6 Valori casuali
7Conditional execution: IF Logical operators. Conditional execution:SWITCH. Iterative execution: WHILE, FOR and DO-WHILE. Comma operator. Ternary operator.Any C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
8Vectors and matrices. Characters and strings. The pointers. Distinctions between pointers and vectors. Pointer arithmetic. Functions on byte blocks. Dynamic memory allocationAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
9Endianess discussion. The system. function Bitwise operators.Any C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
10Text and binary filesAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
11Functions in C. Prototype. Local variables. Parameters and return value. Current and formal parameters. Explicit and implicit parameter passingAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes
12Recursion. Data structures. The typedef operatorAny C text such as Kernighan and Ritchie "Programming Principles and Reference Manual" and also lecture notes

Learning Assessment

Learning Assessment Procedures

Practical test in C.

Normally the test lasts 2 hours and 30 minutes and involves the development of a program in C. All parts of the program can be subject to the test.

 The scores of each component of the test appear in the text of the exercise itself. The minimum score to take the exam is 18. There is no oral exam.

Verification of learning can also be carried out electronically, should the conditions require it.

Information for student with Disabilities and/or SLD: to guarantee equal opportunities and in compliance with the laws in force, interested students can ask for a personal interview in order to plan any compensatory and / or dispensatory measures, based on the didactic objectives and specific needs. It is also possible to contact the referent teacher CInAP (Center for Active and Participated Integration - Services for Disabilities and / or SLD) of our Department.

Examples of frequently asked questions and / or exercises

Examples are present both on the dedicated teams channel and on: http://superpippo.ct.infn.it/~marco/didattica

These examples also provide an accurate description of the evaluation.