Curso de programación desde cero | Programación Orientada a Objetos Principios básicos #7

Curso de programación desde cero | Programación Orientada a Objetos Principios básicos #7

Learning Advanced Programming Concepts

In this section, the instructor introduces advanced programming concepts, specifically focusing on object-oriented programming. The discussion covers the transition from basic programming to more complex applications through the utilization of object-oriented principles.

Introduction to Object-Oriented Programming

  • Object-oriented programming aims to translate real-world entities into digital representations, enabling simulation and abstraction of physical objects.
  • Five fundamental elements in object-oriented programming serve as building blocks for understanding and navigating this programming paradigm effectively.
  • These five basic elements lay the foundation for delving into object-oriented programming, a highly sought-after skill in today's industry landscape.

Superclass and Subclasses in Object-Oriented Programming

  • Each element in object-oriented programming requires a distinct name, such as superclass (e.g., 'Figures'), classes, objects, attributes, and methods.
  • The superclass acts as a unifying entity where all program elements converge for execution, emphasizing the importance of structuring programs around a central superclass.

Inheritance and Object Attributes

  • Subclasses inherit characteristics from the superclass through inheritance, akin to receiving an inheritance from a family member.
  • Objects within classes or subclasses encapsulate attributes and methods that define their unique properties and functionalities.

Understanding Object Attributes

This segment delves deeper into object attributes within object-oriented programming, elucidating how attributes define objects' features and behaviors.

Defining Object Attributes

Introduction to Object-Oriented Programming

In this section, the speaker introduces the concept of object-oriented programming by explaining the importance of variables, attributes, and methods in defining objects like rectangles. The discussion delves into how objects store values and perform actions through methods.

Variables, Attributes, and Methods

  • Objects like rectangles have values stored in variables; for instance, a rectangle can have a base of 5 centimeters and a height of 10 centimeters.
  • Attributes such as base and height are declared as variables to define an object like a rectangle.
  • Methods are actions or instructions that objects can perform; for example, calculating the area of a rectangle involves multiplying its base by its height.

Calculating Area and Cost for Real Estate

This part focuses on applying object-oriented programming concepts to solve a real-world problem related to determining the area and cost of real estate properties based on their dimensions and market prices per square meter.

Problem Scenario Setup

  • Consideration of buying real estate necessitates calculating property area and determining selling costs based on size.
  • Initial scenario involves assessing a rectangular piece of land with dimensions: base - 35 meters, height - 15 meters.

Calculations for Property Cost

  • Area calculation formula: area = base * height; substitution with values yields an area of 525 square meters.
  • Determining total cost: multiply area (525 sqm) by price per sqm (2500 pesos), resulting in a total cost of 1,312,500 pesos.

Variable Declaration and User Input

This segment covers setting up variables in code to calculate property metrics like area before engaging user input to gather specific property dimensions required for further calculations.

Variable Initialization

  • Three essential variables initialized: 'area' (numeric type), 'base' (numeric type), 'height' (numeric type).

User Input Collection

  • User prompted via input function to provide base and height values for the property using text prompts.

Programming Oriented Towards Real Estate Calculation

The focus shifts towards coding practices tailored for solving real estate-related problems efficiently using object-oriented programming principles.

Coding Approach

Understanding Object-Oriented Programming Concepts

In this section, the speaker delves into the fundamental concept of the main method in Java programming and explains the hierarchy of classes, emphasizing the significance of superclasses as the core of a program.

Main Method and Class Hierarchy

  • The main method is crucial in Java programming as it signifies the primary class or superclass where the program execution begins. It serves as a pivotal point for running the entire program.
  • Objects can be placed within a subclass or superclass based on their intended functionality. The placement depends on the desired role within the program.

Creating Objects and Utilizing Classes

  • Demonstrating object creation by adding a new flowchart element named "Rectangle" in Raptor to simulate creating a subclass.
  • Exploring how objects are utilized by instructing an object (in this case, "Rectangle") to calculate its area based on predefined attributes like base and height.

Attribute Handling and Method Execution

  • Discussing attribute representation through variables within objects, showcasing how attributes like base and height are defined.
  • Executing methods within objects by assigning operations such as calculating area using assigned values for base and height.

Output Generation and Program Execution

  • Generating output by instructing the program to display calculated results, such as displaying the calculated area with appropriate formatting.
  • Finalizing object utilization by ensuring proper unit representation in output messages, enhancing clarity and completeness of information presented.

Desarrollo de Programa en Java - Programación Orientada a Objetos

In this section, the speaker discusses the development of a program in Java focusing on Object-Oriented Programming principles.

Calculating Total Cost

  • The formula for calculating the total cost involves multiplying the area of the rectangle by 2500 pesos per square meter.
  • Concatenation is used to determine and display the cost to pay for the land based on the calculated area.

Calling Methods

  • The main method is called within the superclass to execute calculations for area and total cost.
  • The sequence of calling methods ensures first calculating the area of the land before determining its price.

Program Execution

  • Input values for base and height are provided (35 meters and 15 meters respectively), triggering calculations by objects like "Rectángulo" and "Costo."
  • The program displays that the land's area is 525 square meters, leading to a total cost calculation based on the given price per square meter.

Principios de la Programación Orientada a Objetos

This part delves into fundamental concepts of Object-Oriented Programming, emphasizing practical application through program development in Java.

Understanding Object-Oriented Programming

  • Demonstrates how object-oriented programming principles are applied practically in developing programs.
  • Acknowledges that mastering these concepts requires dedicated practice and study beyond what can be covered in one video session.

Additional Resources

  • Offers viewers access to supplementary materials such as PDF documents, Word files, and completed programs for further study.
Video description

Curso de programación sin código, introducción a la Programación Orientada a Objetos (POO). En este vídeo aplicamos los conceptos aprendidos previamente y resolvemos un problema de área y costos de un terreno utilizando clases, atributos y métodos. ¡¡Ayúdame a seguir creciendo, te invito a suscribirte!! La Geekipedia de Ernesto ➞ Facebook https://www.facebook.com/LaGeekipediaDeErnesto/ ➞ Instagram https://www.instagram.com/lageekipedia/ ➞ Twitter https://twitter.com/LaGeekipedia ═════════════════════════════════════════ Link de descarga del ejercicio y archivos explicativos: https://goo.gl/9ks2iC Descarga Raptor portable: https://goo.gl/9KwNL8 Descarga el instalador de Raptor: https://goo.gl/EYMxpf Descarga Raptor desde su sitio oficial: raptor.martincarlisle.com ═════════════════════════════════════════ Música: 1. Tobu - Candyland [NCS Release] https://www.youtube.com/watch?v=IIrCDAV3EgI Tobu ➞ SoundCloud https://soundcloud.com/7obu ➞ Facebook https://www.facebook.com/tobuofficial ➞ Twitter http://www.twitter.com/tobuofficial ➞ Spotify http://smarturl.it/Tobu_Spotify ═════════════════════════════════════════ Vídeo Final: 1. Mount Bromo HD Timelapse Movie by Justin Ng https://www.youtube.com/watch?v=UNs7TkFvK-4 Follow Facebook: justinngphoto.com/facebook Follow Twitter: twitter.com/justinngphoto Follow Google+: plus.google.com/116998818067074636759 To join my photography community: mopsg.com

Curso de programación desde cero | Programación Orientada a Objetos Principios básicos #7 | YouTube Video Summary | Video Highlight