1 / 18

Topic 4: Structural and Object Oriented Programming

Topic 4: Structural and Object Oriented Programming. Visual Programming. Learning outcomes. By the end of this topic, you should be able to: 1. Differentiate between structural and object oriented programming; and 2. Explain the components of object oriented programming.

minh
Télécharger la présentation

Topic 4: Structural and Object Oriented Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 4: Structural and Object Oriented Programming Visual Programming

  2. Learning outcomes • By the end of this topic, you should be able to: • 1. Differentiate between structural and object oriented programming; and • 2. Explain the components of object oriented programming.

  3. The criterion for choosing the appropriate program depends on the type of solutions needed, the method of input by the user, the process involved and the output displayed

  4. Basic concepts of structural programming • Structural programming is a sequential program. This means that the instructions are processed one at a time. After the first instruction is executed, the second instruction is achieved and the process continues until the final instruction is completed.

  5. In structural programming, a program is divided into functions and modules. Solving big and complex problems in structural programming requires dividing tasks into subprograms. The division of tasks to smaller subprograms is known as the 'divide and instruct' concept. • For example, if two numerical values need to perform addition, subtraction, division and multiplication functions, the program will need to divide the main program into smaller programs. • Each task, addition, subtraction, division and multiplication will have its own program. Therefore, the task of the main program is divided into these smaller programs. This enables easier and more effective support.

  6. Structural programming requirements • Structural programming requires a program development environment, language and library. The important requirements are as follows: • 1. Program development environment is the method of writing and implementing a structural program. • 2. Language is the instruction pertaining to the syntax and suitable algorithms. • 3. Library is the support functions that must be prepared to enable the implementation of a structural program by a computer

  7. Importance of structural programming • Structural programming is important because: • (i) It is the basic of learning about other programs. • (ii) It is useful as a student’s first exposure to learning about programming. • (iii) It is easily implemented to simpler programming problems. • (iv) The concept can be applied to complex and big programming problems, but this involves a critical and accurate planning and implementation process

  8. Object oriented programming • Object-oriented programming is a useful programming technique. • The fundamental idea behind an object-oriented language is to combine both data and the functions that operate that data into one single unit. Such a unit is called an object. • An object function, called member functions is to provide the only way to access its data. In object-oriented programming, each object that is built will be used by other programs. • The object is used to receive messages that will result in problem solving. Problem solving needs a different approach

  9. Object oriented description

  10. Basic concepts of object oriented programming • In object-oriented programming, you need to be familiar with three basic components: • (a) Object • (b) Relationship of object behavior and state. • (c) Object interface.

  11. object • An object is the most important element in object-oriented programming. It plays an important role in executing object-oriented based software. • Furthermore, each action by the object-oriented software is the result of the cooperation of the objects in the software that interact with each other to generate a specific action. How can an object be defined? • An object is something that has condition, behavior and identify

  12. Relationship between object and behavior state • The second component to look into in object-oriented programming is object behavior and state. Object behavior and state are very closely related. • The current state of an object represents the cumulative results of the object’s behavior. The object state influences its behavior

  13. Object interface • The final component is object interface. Objects receive messages from servers that require a reaction. The list of messages that are associated with an object is known as the object interface. • In object orientation, the object interface determines the interaction with that object

  14. Class • The objects that are involved in a program are too numerous to be specified one by one. Therefore, the class concept can be used to overcome this problem. • The class concept can be divided into two parts: • (i) Attribute list that is contained in each object in a particular class. • (ii) Behaviour list for each object from that particular class, which is how the object reacts to each message that it understands

  15. Code snippet of object oriented program

  16. Importance of object oriented programming • In the object-oriented concept, there are three important points that you need to know, which are: • (a) Objects and classes can be reused without constructing new ones. • (b) Object-oriented software is easier to operate and modify. • (c) The polymorphisms method, which has not been discussed in this topic, is available in object orientation. It is capable of performing two processes at one time

  17. Summary • Structural and object-oriented programmings are two different concepts. • The criterion for choosing the appropriate program depends on the type of solutions needed, the method of input by the user, the process involved and the output displayed. • Structural programming is a sequential program. This means that the instructions are processed one at a time. • In structural programming, a program is divided into functions and modules. • Structural programming requires a program development environment, language and library

  18. In object-oriented programming, you need to be familiar with three basic components, which are object, relationship of object behavior and state, and object interface. • The class concept can be used to overcome the problem of too numerous objects involved in a program. Two parts of the class concept are attribute list and behaviour list. • Example of a program is given. They are Program 1 and Program 2. The two programs are dependant on each other. Both programs use the Java programming language

More Related