PROGRAMMAZIONE I E LABORATORIO M - Z
Academic Year 2018/2019 - 1° Year- Basic Programming: Fabrizio MESSINA
- Basic programming laboratory: Fabrizio MESSINA
Taught classes: 36 hours
Exercise: 24 hours
Laboratories: 12 hours
Term / Semester: 1°
Learning Objectives
- Basic Programming
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.
- Basic programming 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.
Course Structure
- Basic Programming
Classrooms lessons with slides and blackboard.
- Basic programming laboratory
Classrooms lessons with live coding.
Detailed Course Content
- Basic Programming
Part A - Fundamental of Imperative and Object Oriented Programming (3CFU)
- Introduction to programming:
- Problems; Algorithms; Flowcharts.
- Variables; Expressions; Assignments.
- Structured linear notation; Böhm-Jacopini's theorem.
- Array data structure.
- 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.
- 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.
- 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.
- 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 (2,5CFU)- 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.
- 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
- 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.
Part C - Programming Techniques (0,5CFU)
- Notable algorithms
- Search algorithms: linear in an ordered unordered sequence, with sentinel, search for the maximum / minimum, iterative dichotomous search.
- Sorting algorithms: Bubblesort, Selectionsort, Insertionsort.
- Fusion Algorithms: Natural-merge.
- Recursive methods.
- Definition of recursive methods; Calculus of the factorial.
- Management of calls to methods by activating the stack.
- Queue and non-queue recursion.
- Efficiency of recursion: Fibonacci numbers.
- Recursion applications: dichotomous research, Tower of Hanoi, Binary segmentation of a ruler.
Module D - Object-oriented software design (3CFU)
- 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
- 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.
- Object-oriented design principles
- UML diagrams for classes.
- Design and analysis in the OOP paradigm.
- 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.
- Generic programming.
- Template functions and template classes.
- Introduction to programming:
- Basic programming laboratory
Part A - Fundamental of Imperative and Object Oriented Programming (3CFU)
- Introduction to programming:
- Problems; Algorithms; Flowcharts.
- Variables; Expressions; Assignments.
- Structured linear notation; Böhm-Jacopini's theorem.
- Array data structure.
- 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.
- 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.
- 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.
- 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 (2,5CFU)- 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.
- 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
- 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.
Part C - Programming Techniques (0,5CFU)
- Notable algorithms
- Search algorithms: linear in an ordered unordered sequence, with sentinel, search for the maximum / minimum, iterative dichotomous search.
- Sorting algorithms: Bubblesort, Selectionsort, Insertionsort.
- Fusion Algorithms: Natural-merge.
- Recursive methods.
- Definition of recursive methods; Calculus of the factorial.
- Management of calls to methods by activating the stack.
- Queue and non-queue recursion.
- Efficiency of recursion: Fibonacci numbers.
- Recursion applications: dichotomous research, Tower of Hanoi, Binary segmentation of a ruler.
Module D - Object-oriented software design (3CFU)
- 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
- 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.
- Object-oriented design principles
- UML diagrams for classes.
- Design and analysis in the OOP paradigm.
- 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.
- Generic programming.
- Template functions and template classes.
- Introduction to programming:
Textbook Information
- Basic Programming
-
P. Deitel, H. Deitel, C++ How to Program, 10th Edition
-
Eckel, Thinking in C++, Vol. I, 2°Ed. (anche online ed in italiano)
-
Horstmann, C++ for everyone, 2°Ed. – Wiley (anche online)
-
Pohl, Object-Oriented Programming Using C++, 2° Ed. – Addison Wesley
-
Stroustrup, The C++ programming language, 3°Ed, Addison Wesley 7.
Textbook (1), (2), (3) are for beginners. In particular, textbook (3) is strongly suggested to the beginners as it contains many excercises. Texbook (4) is for intermediate level. Texbook (7) is for advanced programmers.
-
- Basic programming laboratory
-
P. Deitel, H. Deitel, C++ How to Program, 10th Edition
-
Eckel, Thinking in C++, Vol. I, 2°Ed. (anche online ed in italiano)
-
Horstmann, C++ for everyone, 2°Ed. – Wiley (anche online)
-
Pohl, Object-Oriented Programming Using C++, 2° Ed. – Addison Wesley
-
Stroustrup, The C++ programming language, 3°Ed, Addison Wesley 7.
Textbook (1), (2), (3) are for beginners. In particular, textbook (3) is strongly suggested to the beginners as it contains many excercises. Texbook (4) is for intermediate level. Texbook (7) is for advanced programmers.
-