PROGRAMMING UNIT 2
cod. 1000535

Academic year 2007/08
1° year of course - First semester
Professor
Academic discipline
Informatica (INF/01)
Field
Formazione interdisciplinare e applicativa
Type of training activity
Related/supplementary
32 hours
of face-to-face activities
4 credits
hub:
course unit
in

Integrated course unit module: PROGRAMMING I AND PROGRAMMING II

Learning objectives

The course is intended to provide foundations of imperative programming as well as 'object-oriented' programming, using C++ as the reference programming language.<br />

Prerequisites

<br /> 

Course unit content

<br />Problems and algorithms: basic notions, flow-charts - Programming languages. Program execution (translation vs. interpretation) - Program structure. A sample program in C++ - Constants and variables - Elementary data types in C++ -Assignment and compound statement - Basic input/output - Operators and expressions - Control structures (selection, iteration). Structured stratements in C++ - Data structures (abstract vs. concrete). Arrays in C++. Matrices. Strings. 'struct'. Tables (hints) - The 'typedef' declaration.<br />Subprograms: motivations. Function declaration and call in C++ - Parameter passing: by value, by reference. 'void' functions - Recursive functions - Scope rules in C++. Local vs. global declarations - File management in C++.<br />Class and object declaration. Accessing member functions and data of a class - Class constructors - A sample class: 'rational' - Function and operator overloading - The 'string' class - Pointers and dynamic memory allocation. Arrays and pointers - A sample class: 'int_vett' - The assignment operator. The copy constructor. Class destructors - Object life-time (hints) - Abstract data types (ADT) (hints). <br />Exception handling: motivations. Constructs for exception handling in C++ - Parametric classes ('template'): declaration, instantiation. A sample class: 'vett<T>' - Parametric functions (hints) - Inheritance. 'public' vs 'private' derivation. Multiple inheritance (hints). 

Full programme

- - -

Bibliography

<br />H.M. Deitel, P.J. Deitel. C++ Fondamenti di programmazione, Apogeo, 2003, 696 pages.<br />[OR] S. Lippman, J. Lajoie. C++: Corso di programmazione, 3a Ed., Addison-Wesley, 2000.

Teaching methods

Exams<br />Written and oral exam, plus development and demo of a<br />practical application written in C++ <br />

Assessment methods and criteria

- - -

Other information

- - -