PROGRAMMAZIONE I E LABORATORIO M - Z

Academic Year 2021/2022 - 1° Year - Curriculum Elaborazione Dati e Applicazioni and Curriculum Sistemi e Applicazioni
Teaching Staff Credit Value: 9
Scientific field: INF/01 - Informatics
Taught classes: 36 hours
Exercise: 24 hours
Laboratories: 12 hours
Term / Semester:

Learning Objectives

  • PROGRAMMAZIONE I

    The course presents fundamentals of programming computers by adopting C ++ as the reference language. In particular, basic concepts of structured programming and the OOP (Object-Oriented Programming) are introduced. Furthermore, encoding of fundamental algorithms and some OOP software design techniques are discussed.

    Knowledge and understanding the primary objective of the course is the students' acquisition of the "philosophy" of the structured programming and of the OOP, as well as the detailed knowledge of the syntax and the semantics of the C++ programmig language.

    The course pays particular attention to the development of well-written and well-structured code using the basic techniques for software development in the Object-Oriented paradigm.

    Applying knowledge and understanding the goal of the course is to provide the tools to achieve the following skills: - Translate algorithmic ideas into code; - Design, describe and implement programs in C++; - Debug C++ programs with professional tools; - Understand simple recursive algorithms; - Analyze and describe Object-Oriented solutions using UML (Unified Language Modeling) class diagrams; - Design, implement and correctly use hierarchies of polymorphic classes and generic code; - Read, understand and analyze third-party C++ code also in terms of efficiency; - Orient yourself in the documentation of the libraries.

    Making judgments: through the examination of a large number of examples of Object-Oriented programs and various practical programming sessions, the student will be able, both independently and in a cooperative form, to analyze problems and design and implement related software solutions.

    Communication skills the student will acquire the necessary communication skills and expressive appropriateness in the use of technical verbal language and UML visual language in computer programming.

    Learning skills the course aims to provide to the student the theoretical and practical methodologies needed in professional contexts and, in particular, the ability to formulate ad-hoc algorithms for problem solving and the opportunity to learn quickly the C++ programming language.

    Should teaching be carried out in mixed mode or remotely, it may be necessary to introduce changes with respect to previous statements, in line with the programme planned and outlined in the syllabus.

    Learning assessment may also be carried out on line, should the conditions require it.

  • Laboratory

    The course presents fundamentals of programming computers by adopting C ++ as the reference language. In particular, basic concepts of structured programming and the OOP (Object-Oriented Programming) are introduced. Furthermore, encoding of fundamental algorithms and some OOP software design techniques are discussed.

    Knowledge and understanding the primary objective of the course is the students' acquisition of the "philosophy" of the structured programming and of the OOP, as well as the detailed knowledge of the syntax and the semantics of the C++ programmig language.

    The course pays particular attention to the development of well-written and well-structured code using the basic techniques for software development in the Object-Oriented paradigm.

    Applying knowledge and understanding the goal of the course is to provide the tools to achieve the following skills: - Translate algorithmic ideas into code; - Design, describe and implement programs in C++; - Debug C++ programs with professional tools; - Understand simple recursive algorithms; - Analyze and describe Object-Oriented solutions using UML (Unified Language Modeling) class diagrams; - Design, implement and correctly use hierarchies of polymorphic classes and generic code; - Read, understand and analyze third-party C++ code also in terms of efficiency; - Orient yourself in the documentation of the libraries.

    Making judgments: through the examination of a large number of examples of Object-Oriented programs and various practical programming sessions, the student will be able, both independently and in a cooperative form, to analyze problems and design and implement related software solutions.

    Communication skills the student will acquire the necessary communication skills and expressive appropriateness in the use of technical verbal language and UML visual language in computer programming.

    Learning skills the course aims to provide to the student the theoretical and practical methodologies needed in professional contexts and, in particular, the ability to formulate ad-hoc algorithms for problem solving and the opportunity to learn quickly the C++ programming language.

    Should teaching be carried out in mixed mode or remotely, it may be necessary to introduce changes with respect to previous statements, in line with the programme planned and outlined in the syllabus.

    Learning assessment may also be carried out on line, should the conditions require it.


Course Structure

  • PROGRAMMAZIONE I

    Classrooms lessons with slides and blackboard.

  • Laboratory

    Classrooms lessons with live coding.


Detailed Course Content

  • PROGRAMMAZIONE I

    Part A - Fundamental of Imperative and Object Oriented Programming (3CFU)

    1. Introduction to programming:
      • Problems; Algorithms; Flowcharts.
      • Variables; Expressions; Assignments.
      • Structured linear notation; Böhm-Jacopini's theorem.
      • Array data structure.
    2. The C++ Programming language.
      • Programming languages: machine, assembly and high level.
      • Translation problem: compilation and interpretation.
      • Installation of the compiler; First program: Editing, Compiling, Running, Debugging.
    3. Constructs of the language
      • Data types; Predefined operators; Type conversions; I/O management.
      • Flow control: if-then-else selection and switch constructs, while and do-while constructs.
    4. Introduction to Object Oriented Programming
      • Objects: state and behavior; Classes; Instance of objects: constructors.
      • Messages: structure, parameters, types of messages.
      • Composition and aggregation of objects.
    5. Arrays and character strings
      • Arrays of fundamental types and array of objects. Two-dimensional arrays.
      • Iterative construct for.
      • Character sequences: char arrays and string objects.


    Part B - Advanced features of the C ++ language (3 CFU)

    1. Class definition
      • Class structure: attributes and operations; Access control.
      • Implementation of methods: return value, parameters by value and by reference; Variables, allocation and their scope.
      • C++ constructors.
    2. Pointers and Arrays
      • Pointers; Addressing and dereferencing operators.
      • Arithmetic of pointers. Pointers and arrays; Pointers as a parameter; Dynamic memory allocation.
      • Function pointers; The pointer this; Multilevel addressing. References; enumerations; Unions; Bit fields.
      • 2D Arrays: Arrays dynamically allocated, Arrays as parameters, Sparse Arrays; Multidimensional Arrays
    3. Advanced elements of the language
      • The const keyword for pointers and methods; Standard arguments for function parameters. Namespace clause; Forward declarations; Inline functions.
      • Implementation of the composition / aggregation relationship.
      • Overloading methods; Constructors and destructors. Copy constructor.
      • Functions and friend classes; Static attributes and methods.
      • Management of calls to methods by activating the stack.

    Module C - Object-oriented software design (3CFU)

    1. Inheritance
      • Definition; IS-A relationship; Derivations and methods of access: protected.
      • Hereditary hierarchies of classes. Methods overriding. Operator :: scope resolver.
      • Initialization list and execution modalities of inherited constructors and destructors.
      • Multiple inheritance. Virtual classes
    2. Polymorphism and abstract classes.
      • Pointers to derived classes; Virtual functions; Late-binding. Polymorphism.
      • Hereditary hierarchies of polymorphic classes.
      • Pure virtual functions; Abstract classes; Interfaces.
      • RTTI: typeid and dynamic_cast.
    3. Object-oriented design principles
      • ​​UML diagrams for classes.
      • Design and analysis in the OOP paradigm.
    4. Overloading of operators.
      • Type of overloading of operators: non-member, friend, member.
      • Prefix and postfix operators "++" and "-".
      • Overview of assignment operators "=", indexing "[]" and "()" and cast.
      • I / O operators.
    5. Generic programming.
      • Template functions and template classes.
  • Laboratory
    1. Basic Concepts

    2. C++ Language

    3. Constructs of the language C++

    4. Object Oriented Programming in C++

    5. Arrays and character strings in C++

    6. Class definition in C++

    7. Pointers and Arrays in C++

    8. Advanced elements of the language C++

    9. Inheritance, Polymorphism and abstract classes in C++

    10. Overloading of operators in C++

    11. Class Template and Functions Template in C++

Textbook Information

  • PROGRAMMAZIONE I
    1. P. Deitel, H. Deitel, C++ How to Program, 10th Edition

    2. Eckel, Thinking in C++, Vol. I, 2°Ed. (anche online ed in italiano)

    3. Horstmann, C++ for everyone, 2°Ed. – Wiley (anche online)

    4. Pohl, Object-Oriented Programming Using C++, 2° Ed. – Addison Wesley

    5. Stroustrup, The C++ programming language, 3°Ed, Addison Wesley

  • Laboratory
    1. H.M. Deitel, P. J. Deitel, C++ Fondamenti di programmazione – Maggioli Editore (2014).

    2. Eckel, Thinking in C++, Vol. I, 2°Ed. (disponibile gratuitamente online)

    3. Horstmann, C++ for everyone, 2°Ed. – Wiley

    4. Stroustrup, Programming: Principles and Practice Using C++. (Addison-Wesley ISBN 978-0321-992789, http://www.stroustrup.com/programming.html).

    5. Stroustrup, The C++ Programming Language - 4th Edition ( Addison-Wesley ISBN 978-0321563842, http://www.stroustrup.com/4th.html )