Programação Orientada a Objetos

Base Knowledge

None in particular.

Teaching Methodologies

In classes, the theoretical exposition of themes is made using small examples, followed by the resolution of practical exercises that consist of creating code.

Learning Results

Objectives:

  • Acquire knowledge about the concepts of object-oriented programming;
  • Acquire the ability to develop problem-solving strategies;
  • Be able to code problem-solving strategies in the C++ programming language.

 

Skills to develop:

  • Simulate step-by-step the execution of simple programs;
  • Write programs to solve simple problems (examples: numerical calculation, word processing);
  • Break down problems into sub-tasks that can be implemented as reusable functions;
  • Test and fix errors in programs.

Program

1. Introduction to object-oriented programming and C++ language
1.1 General concepts
1.2 Encapsulation, polymorphism and inheritance

2. Main differences between C and C++
2.1 Standard data input and output
2.2 Organization of programs in files
2.3 Comments
2.4 Definition of local variables
2.5 Predefined types
2.6 Cast
2.7 References
2.8 Constants

3. Functions
3.1 Function overload
3.2 Arguments by omission

4. Classes
4.1 Class definition syntax
4.2 Classes as structure evolution
4.3 Member functions
4.4 Inline member functions
4.5 The this pointer
4.6 Visibility of variables and member functions of a class
4.7 Constructors
4.8 Non-dynamic vectors and matrices of objects

5. Life cycle of objects
5.1 Destructor
5.2 Construction by copy
5.3 Assignment operator

6. Dynamic Objects
6.1 The new and delete operators
6.2 Dynamic object vectors and matrices

7. Redefining operators
7.1 Introduction to redefinition of operators
7.2 Operator functions
7.3 Unary and binary operators
7.4 Option of member operators vs. non-member operators
7.5 Conversions

8. Composition and aggregation
8.1 Composition as opposed to aggregation
8.2 Composition without dynamic memory
8.2.1 Syntax, initialization requirements
8.2.2 Order of calling constructors and destructors
8.2.3 Aggregation by reference and pointer
8.3 Composition through dynamic memory
8.3.1 Concept of managing own resources in classes
8.3.2 Member variables that are pointers to dynamic memory
8.3.3 Destructor, assignment operator, copy constructor

9. Inheritance in C++
9.1 Derived classes
9.2 Composition vs. derivation
9.3 Forms of derivation and accessibility
9.4 Constructors and destroyers
9.5 Copy constructor and assignment operator in derived classes
9.6 Inheritance and overloaded functions

10. Polymorphism
10.1 Upcasting, downcasting and dynamic casting
10.2 Virtual functions
10.3 Abstract classes and pure virtual functions
10.4 Overloaded virtual functions and redefinition in derived classes
10.5 Virtual destructors

Curricular Unit Teachers

Jorge Miguel Tavares Couceiro de Sousa

Grading Methods

  • The evaluation is carried out through a final exam, in accordance with the rules in force at the IPC/ISEC.
  • Access to the assessment depends on the presence of at least 50% of the total contact hours, monitored by the attendance record made during the classes.

    Internship(s)

    NAO

    Bibliography

    • Rodrigues, P, Pereira, P, & Sousa, M. Programação em C++ : conceitos básicos e algoritmos (Qualquer Edição). FCA – Editora de Informática, Lda..
      Cotas na biblioteca do ISEC: 1A-1-288 (ISEC) – 09519, 1A-1-357 (ISEC) – 11130, 1A-1-173 (ISEC) – 11802, 1A-1-213 (ISEC) – 11803, 1A-1-426 (ISEC) – 16023, 1A-1-324 (ISEC) – 19320.
    • Stroustrup, B (2013). The C++ Programming Language (4th Edition).  ‎ Addison-Wesley Professional.