FUNDAMENTALS OF COMPUTER SCIENCE + PROGRAMMING LABORATORY
cod. 1002526

Academic year 2024/25
1° year of course - First semester
Professor
Massimo BERTOZZI
Academic discipline
Sistemi di elaborazione delle informazioni (ING-INF/05)
Field
A scelta dello studente
Type of training activity
Student's choice
72 hours
of face-to-face activities
9 credits
hub:
course unit
in ITALIAN

Learning objectives

The objective of the course is to provide the student with the ability to understand the principles of computer science and programming using C as the reference language and in particular:
* Data representation
* Algorithm concept
* Basic architecture of processing systems
* Procedural programming paradigm
* Introduction to software engineering

The skills to apply the knowledge listed concern the development of the so-called "computational thinking":
* Decomposition of complex problems
* Top-Down problem solving
* Syntax and semantics of the C language

Prerequisites

No propaedeutics. However, it is assumed that the student knows the basics of using computers and the Internet - the equivalent of modules 1, 2, 3 and 7 of the ECDL (European Computer Driving Licence) syllabus.

Course unit content

1. Introduction to programming
2. algorithms
3. basic computer architectures
4. programming languages
5. representation of numbers in computer science
6. C proframming language
7. expressions in C
8. flow control
9. Data types in C
10. Arrays
11. Dynamic memory allocation and pointers
12. C strings
13. functions
14. I/O in C
15. composite data
16. function pointers

Full programme

1. Introduction to programming

2 algorithms
- algorithm concept
- meaning of program
- approach to problem solving
- pseudocode and flowcharts
- top-down and bottom-up approaches


3 basic computer architecture
- history and evolution of computing architectures
- main elements of a CPU
- von Neumann architecture

4 programming languages
- language level
- machine and assembly languages
- high level languages
- interpretation and compilation

5 representation of numbers in computer science
- the memory
- representation systems
- binary format and conversions
- hexadecimal format
- the sign in numbers, complement to 1 and 2
- fixed and floating point numbers

6 the C programming language
- why the C?
- the standard
- compilation phases
- introduction to the basic elements of the language

7. expressions in C
- Operators & Operands
- Typologies
- Expressions
- Assessment
- Precedence & Associativity
- Side effects

8. flow control
- Jacopini Böhm Theorem
- Sequence
- Selection
-if()
- switch()-case
- Iterations
- while()
- do-while()
-for(;;)

9 Data types in C
- Variable definition
- Data types in C
- Scalar data
- Floating point
- Whole
- Combination of different types of data
- Conversions
- Field of visibility of the variables

10 Arrays
- One-dimensional arrays
- Definition
- I use
- Initialization
- Errors
- Multidimensional arrays

11 Dynamic memory allocation and pointers
- Array limit
- Variable Length Array
- Pointers
- The void type
- Memory management functions
- Common mistakes

12 strings in C
- String definition
- Memorization
- I
- The string.h library
- Main operations
- String arrays

13 functions
- Modularity
- The default functions
- The C standard library
- Define a function
- Return type
- Formal Parameters
- Data transfer
- The prototypes
- Recursion

14 I/O in C
- the streams
- file concept
- main operations
- definition
- associate a stream
- read/write and other operations
- closure
- textual and binary files
- Console I/O

15 composite data
- composite data motivation
- the struct construct
- definition
- use
- access items
- padding
- mention of union and enum

16 function pointers
- address of a function
- definition and use of function pointers
- callbacks and examples
- qsort()
- bsearch()

Bibliography

K.N. King, C Programming: A Modern Approach (2nd Edition), W W Norton & Co
Bellini Guidi, Linguaggio C, Mc Graw Hill
B.W. Kernighan e D. Ritchie, The C Programming Language: ANSI C Version, Pearson College
Darnell Margolis, C manuale di programmazione, Mc Graw Hill

Teaching methods

Classroom lessons, with the help of slides made available to students in advance. Guided solution of classroom exercises. Programming exercises in the laboratory.

Laboratory exercises are the most critical part of the course. The proposed exercises are relayed to the same general topics as the classroom lessons. The idea is to introduce the principles of programming, guiding the student to the solution of problems with an increasing level of complexity.

Assessment methods and criteria

Programming test, using C, in two hours in the laboratory

Other information

- - -

2030 agenda goals for sustainable development

- - -