Learning outcomes of the course unit
The course provides the basic instruments and techniques to design and develop simply programs using a sequential, imperative programming language. In particular, the course focuses on an imperative fragment of the C++ language.
Course contents summary
Problems, instances, algorithms and executors. Representation of algorithms: flow charts, programming languages and programs, pseudo-codes. Syntax and semantics.
Introduction to an imperative subset of the C++ language: data types, values, identifiers, variables, expressions, instructions and functions; input and output. Structure of a program.
Elementary data types: integer and floating point numeric types, boolean types, character types, enumerations; literal constants. Declarations and definitions: variables and initialization; symbolic constants.
Expressions and instructions: assignment, operators, mixed arithmetic and data type conversions; simple and compound instructions, sequences of instructions, conditional and iterative instructions.
Input and output.
Compound data types: arrays, structures and C-style strings.
The procedural abstraction: declaration, definition and use of functions. Parameter passing and return values. Local and global variables: action field and lifecycle. Recursive functions.
Pointers and their arithmetic.
Basics on the data types and functions of the standard library.
Text and binary files via streams.
Program execution: interpreted, compiled and mixed approaches. Programming environments: editors, compilers, linkers, debuggers. The compilation phases. Structuring source codes: inclusion directives.
Use of the imperative fragment of the C++ to code algorithms for:
- Numeri analysis: solving polynomial equations via bisection, rectangle method to compute definite integrals, convergent series and successive approximations;
- Manipulation of vectors in the space;
- Creation and processing of BMP images;
- Structured data manipulation in CSV and binary formats.
The couse has no main textbook. The following are useful references.
References available on the Web:
A. Ficarra, M. Murgia. Il linguaggio di programmazione C++ standard, 2003.
R. Miller, D. Clark, B. White, W. Knottenbel. An Introduction to the Imperative Part of C++, 1999 (in lingua inglese).
B. Eckel. Thinking in C++ (2nd edition), Volumes 1 & 2.
H.M. Deitel, P.J. Deitel. C++ Fondamenti di programmazione, Apogeo, 2003.
S. Lippman, J. Lajoie. C++: Corso di programmazione, terza edizione, Addison-Wesley, 2000.
P. Marotta. C++: una panoramica sul linguaggio (seconda edizione)
B. Stroustrup. C++: Linguaggio, libreria standard, principi di programmazione, terza edizione, Addison-Wesley, 2000.