1.2 Control Structures and Object-Oriented Programming
1.2 Control Structures and Object-Oriented Programming
Data Analysis
1.2 Control Structures and Object-Oriented Programming
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 1
1
INTRODUCTION
Hello Everyone,
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 2
2
INTRODUCTION
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 3
3
WHAT ARE PROGRAMMING CONTROL
STRUCTURES?
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 4
4
CONTROL STRUCTURE TYPES
Sequence: This control structure represents the linear and sequential execution of
code, where statements are executed one after another in the order they appear. This is
the simplest type of programming control structure and forms the foundation of most
programs.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 5
5
CONTROL STRUCTURE TYPES
Selection: This control structure enables a program to choose between two or more
paths of execution based on specific conditions. Selection structures include conditional
statements such as if-else and switch-case, which use Boolean expressions to evaluate
the conditions and execute the appropriate block of code.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 6
6
CONTROL STRUCTURE TYPES
Iteration: This control structure allows certain blocks of code to be executed repeatedly
as long as a condition remains true. Iteration structures include loops like the for loop,
while loop, and do-while loop.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 7
7
WHAT IS A PROGRAMING LANGUAGE?
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 8
8
REAL LIFE EXAMPLES
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 9
9
REAL LIFE EXAMPLES
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 10
10
Coordinación de Tecnologías
para la Educación
Selected Topics in Information Technologies - Edgar Olivares (2024) 11
11
INTRODUCTION
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 12
12
INTRODUCTION
With the OOP paradigm, what is sought is to stop focusing on the pure logic of programs,
to start thinking about objects, which forms the basis of said paradigm. This helps a lot in
large systems, because instead of thinking about functions, we think about the
relationships or interactions of the different elements of the system.
OOP allows code to be reusable, organized, and easy to maintain. And it follows the
software development principle used by many programmers DRY (Don't Repeat Yourself),
to avoid duplicating the code and create efficient programs.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 13
13
WHAT IS OOP?
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 14
14
OOP Structure
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 15
15
WHAT IS THE STRUCTURE OF OBJECT-
ORIENTED PROGRAMMING?
Classes are user-defined data types that act as the blueprint for individual objects,
attributes and methods.
Objects are instances of a class created with specifically defined data. Objects can
correspond to real-world objects or an abstract entity. When class is defined initially,
the description is the only object that is defined.
Methods are functions that are defined inside a class that describe the behaviors of
an object. Each method contained in class definitions starts with a reference to an
instance object. Additionally, the subroutines contained in an object are called
instance methods. Programmers use methods for reusability or keeping functionality
encapsulated inside one object at a time.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 16
16
WHAT IS THE STRUCTURE OF OBJECT-
ORIENTED PROGRAMMING?
Attributes are defined in the class template and represent the state of an object.
Objects will have data stored in the attributes field. Class attributes belong to the
class itself.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 17
17
WHAT IS A PROGRAMING LANGUAGE?
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 18
18
OOP Principles
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 19
19
PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
Encapsulation
Encapsulation presents all the important information of an object within the object and
only exposes the chosen information to the outside world.
This property ensures that the information of an object is hidden from the outside
world, grouping in a class the characteristics or attributes that have private access, and
the behaviors or methods that have public access.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 20
20
PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
Abstraction
In OOP, programs are usually very large and objects communicate a lot with each other.
In this way, abstraction makes it easier to maintain large code, where different changes
may arise over time.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 21
21
PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
Heritage
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 22
22
PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
Polymorphism
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 23
23
PRINCIPLES OF OBJECT ORIENTED
PROGRAMMING
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 24
24
BENEFITS OF OBJECT ORIENTED
PROGRAMMING
● Code reuse.
● Converts complex things into simple
reproducible structures.
● Avoid code duplication.
● Allows teamwork thanks to encapsulation.
● Since the class is well structured, it allows
errors to be corrected in various places in the
code.
● Abstraction allows us to build more complex
systems in a simpler and more organized way.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 25
25
OOP PROGRAM LANGUAGES EXAMPLES
Java is widely used in the development of enterprise applications, embedded systems, mobile
applications (Android) and in academia.
Python is known for its readability and simplicity, making it suitable for rapid prototyping, web
development (with frameworks like Django and Flask), task automation, data analysis, and data
science.
PHP is widely used for web development. It is mainly used in creating dynamic websites and
applications.
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 26
26
QUESTION?
Why OOP and Control Structures are important for
programing development?
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 27
27
CONCLUSION
In conclusion we can see that there is a lot to think about before starting a
programming development. Nowadays programs are very complex and with
thousands or millions of lines of programming, and being structured helps us to
make our lives easier, to avoid spending hours looking for any errors in the program
and to avoid spending a lot of resources (repeating code for example). In this
presentation we saw the most used ways today to organize our code when speaking
about programing paradigms and control structures
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 28
28
BIBLIOGRAPHY CONSULTED
Study Smarter, (-) Programming Control Structures
https://www.studysmarter.co.uk/explanations/computer-science/computer-programming/programming-control-structures/
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 29
29
Todos los recursos educativos abiertos, elaborados por la Universidad
Anáhuac México y su equipo de docentes, se proveen bajo la licencia
Creative Commons Reconocimiento -NoComercial- SinObraDerivada CC
BY-NC-ND. http://creativecommons.org/licenses/by-nc-nd/4.0/
Coordinación de Tecnologías
para la Educación
Contemporary Developments - Edgar Olivares (2024) 30
30