Computer programming

A.Y. 2019/2020
Lesson for
12
Max ECTS
120
Overall hours
SSD
INF/01
Language
Italian
Learning objectives
The goal is to introduce students to structured imperative programming and small-scale problem solving
The student should acquire the ability to write and tune a program that automatizes a simple task; moreover, (s)he should be able to understand how a small piece of code works, to find the reasons of a malfunction and to correct it appropriately

Course structure and Syllabus

Edition 1
Active edition
Yes
Responsible
Laboratorio
INF/01 - INFORMATICS - University credits: 3
Laboratories: 48 hours
Shifts:
Turno A (cognomi da A a Cao)
Professor: Morpurgo Anna Chiara Giovanna
Turno B (cognomi da Cap a De)
Professor: Trentini Andrea Mario
Teoria
INF/01 - INFORMATICS - University credits: 9
Lessons: 72 hours
Professor: Boldi Paolo
Shifts:
Lettere A-E
Professor: Boldi Paolo
ATTENDING STUDENTS
Teoria
Syllabus
SYLLABUS DRAFT
[TWG = The Way to Go: A Thorough Introduction to the Go Programming Language by Ivo Balbaert]
1. Course introduction; Computer architecture; Computer science; Programming languages ​​(machine language, assembly, high level); Computer as a programmable machine
2. The von Neumann machine. Information (bits, bytes, ...). Loader, fetch-decode-execute. CPU architecture: ALU and CU. An example of a CPU; assembly languages
3. Software lifecycle. Programming tools. History of go. The first program in go [TWG4]. The go tool. Compilation. Execution. Formatting. Documentation [TWG3]
4. Discussion of lexical and syntactic aspects. Comments [TWG4]. Types. Classification of types (basic types, compound types, interfaces). Variables: name, type, value, scope. Multiple declaration, assignments, short-assignment [TWG4]
5. Basic I / O. Basic numeric types (int, float64). Numerical expressions. Conversions. Introduction to the complex type. Unused variables and blank variable [TWG4]
6. Binary selection (if). Local variables. The bool type and the Boolean operators. Exercises [TWG5]
7. The iteration (for): unary, ternary, zeroary versions. Exercises [TWG5]
8. Digital representation of data. Positional notation. Representation of negative integers. Representation range, overflow. Overview of the representation of the reals: fixed and mobile point (IEEE 754 standard). Characters (ASCII, Unicode, UTF-8) [Handouts]
9. Fixed-length numeric basic types. Rune type. String type: differences between raw and utf-8. Len function. Fourth form of the for (range) cycle [TWG4, TWG5]
10. Exercises: nested cycles. Break and continue instructions [TWG5]
11. Multi-way selection (switch) [TWG5]
12. Arrays and slices. Initializers. Application of the for ranges. Append function [TWG7]
13. Exercises. Command-line arguments. Strconv package
14. Functions: parameters, signature. Passage by value. Returned values. Values ​​returned with a name. [TWG6]
15. Exercises
16. Sorting and binary research
17. Generation of pseudo-random numbers. Math package. Exercises
18. Maps. Application of the for ranges. Exercises [TWG8]
19. Recursion. Execution stack [TWG6]
20. Exercises using recursion
21. Pointers: operators * and &. [TWG4]
22. Exercises with pointers
23. Structures [TWG10]. Methods [TWG10] (outline)
24. Exercises on structures and methods
25. Closures. Example: sort, binary search
26. Advanced I / O. File [TWG12]
27. Exercises; defer [TWG6]
28. Packages and structure. Visibility of the variables
29. Testing [TWG13]
30. Interfaces [TWG11]
31. Implementation of a search engine (reverse indices)
32. Go routines and channels [TWG14]
33. Exercises on concurrency
34. The C language. Using gcc. Syntactic differences: point-and-comma, brackets in control structures, declarations of variables, types and functions. Differences in flow-control structures (switch, while, do-while). Use of simple instructions in control structures. Inclusion vs. import.
35. Absence of strings, slices, maps; use of char[] for strings. Elementary types and compiler dependency; use of specific types (stdint.h, bool.h). Implicit cast. Definition of macros. Library functions. Command line parameters
36. Pointers, pointer arithmetic. Memory management: malloc, free
Laboratorio
Syllabus
NON-ATTENDING STUDENTS
Teoria
Syllabus
-
Laboratorio
Syllabus
Lesson period
First semester
Edition 2
Active edition
Yes
Laboratorio
INF/01 - INFORMATICS - University credits: 3
Laboratories: 48 hours
Professor: Casazza Marco
Shifts:
Turno C (cognomi da Di a Loc)
Professor: Casazza Marco
Turno D (cognomi da Lod a Op)
Professor: Casazza Marco
Teoria
INF/01 - INFORMATICS - University credits: 9
Lessons: 72 hours
Professor: Vigna Sebastiano
Shifts:
Lettere F-M
Professor: Vigna Sebastiano
Syllabus
The syllabus is shared with the following courses:
- [F3X-36](https://www.unimi.it/en/ugov/of/af20200000f3x-36)
Lesson period
First semester
Edition 3
Active edition
Yes
Laboratorio
INF/01 - INFORMATICS - University credits: 3
Laboratories: 48 hours
Professor: Capra Lorenzo
Shifts:
Turno E (cognomi da Oq a Sa)
Professor: Capra Lorenzo
Turno F (cognomi da Sb a Z)
Professor: Capra Lorenzo
Teoria
INF/01 - INFORMATICS - University credits: 9
Lessons: 72 hours
Professor: Ceselli Alberto
Shifts:
Lettere N-Z
Professor: Ceselli Alberto
Syllabus
The syllabus is shared with the following courses:
- [F9X-31](https://www.unimi.it/en/ugov/of/af20200000f9x-31)
Lesson period
First semester
Lesson period
First semester
Assessment methods
Esame
Assessment result
voto verbalizzato in trentesimi