Docsity

Unit 1 Programming Assignment 2, Assignments of Computer Science

Toggle sidebar
bg1
Contents
1. An explanation of procedural, object-oriented and event driven programming paradigms,
identifying their individual characteristics and the relationship between them........................ 2
Reference................................................................................................................... ........ 7
................................................................................................................................. .............. 7
pf3
pf4
pf5

Partial preview of the text

Download Unit 1 Programming Assignment 2 and more Assignments Computer Science in PDF only on Docsity!

Contents

  1. An explanation of procedural, object-oriented and event driven programming paradigms, identifying their individual characteristics and the relationship between them........................ 2 Reference........................................................................................................................... 7 ............................................................................................................................................... 7

1. An explanation of procedural, object-oriented and event

driven programming paradigms, identifying their individual

characteristics and the relationship between them.

Object-oriented

Object oriented programming is defining the data structure types and the functions types that are applied in data structure. Object are defined as fields of data that contain attributes and behaviour that are unique.

Characteristics

Encapsulation

Encapsulation have similarities with abstraction, as encapsulation explains the idea how data and methods can be bundled and worked into a class. Different objects do not have the authority to access or make changes to the class, however, can only call a list of functions or methods. This process is known as information hiding and this provides greater security to the program and can prevent data corruption.

Polymorphism

Polymorphism is a result of inheritance. It’s where the method is determining runtime based on objects types. This is resulting in one class inheriting from another and overwriting a method of a particular.

Inheritance

Is forming classes by utilising the classes that have been defined. It also permits classes to be enabled so it can inherit attributes and methods from other classes. The inheriting classes are able to add extra attributes and/or methods of its own.

Abstraction

Abstraction is a programming tool to manage complexity and it’s not only limited to OOP. Examples of abstraction can be making coffee as you are only required to know how to utilise the coffee machines but don’t have understand how the coffee machine working internally. Like when you are writing a code there is abstractions being done as when you are creating a procedure a series of executable operations are abstracted. In OOP software programs, the classes do the same as they hide all the details of the internals. Marcos and interface, you see do the all the abstractions.

Event Driven

In programming, event-driven is programming of paradigm that is applied to determine the program’s flow that is determined by the user’s actions. To the programmers the events monitored by the code are called an event listener. When detecting an assigned event that has occurred an event handler is ran.

Characteristics

inform the computer what is required to do step-by-step in order to complete the task at hand.

Characteristics

Modularity is the breakdown of programming code, which is separated into subroutines, each carry out an individual task. Procedures is code’s block that contain step by step instructions. Many procedures maybe consisted into a program. Functions : There are similarity with functions and procedures, but they return a value. Local variables : While the program is running a variable stores data. Local variables can only be utilised in the declared blocks. Global variables : Throughout the programming code global variables can be utilised.

Programming paradigms

In programming, event-driven is programming of paradigm that is applied to determine the program’s flow that is determined by the user’s actions. Serval statement are consisted of the paradigm and the result are stored after the execution. A list of instructions is written to tell the computer what to do with steps.

Imperative programming paradigm

In the paradigm of imperative programming, the order of the steps is vital as each step will consist of different consequences and they are dependent on the variables by the current values when the step is executed.

Declarative programming paradigm

Building programs in a style that displays the logic of a computation without having the control flow talked about. Declarative programming is defined by the programmer in what is required to be done without the need in defining how it needs to be implemented. It mainly focuses on what is required to be done instead of achieving with instructions. The clear difference is that declarative tells you what to do and imperative tells you how to do something. An example of the difference between imperative and declarative is thinking of giving driving directions to a destination. An imperative method would be involving step-by-step instructions on how to arrive at the destination, whereas declarative approach involves in providing the address to the destination with a little concern on how to arrive there.

Logic programming paradigm

A declarative approach is utilised by logic programming in problem solving which is based on formal logic. Facts and clauses are what makes the logic programming instead of instructions as it utilises everything it knows and then it creates a world where all the facts and clauses are true.

Reference Definitions, E. and Hope, C., 2020. What Is Event-Driven Programming?. [online] Computerhope.com. Available at: [Accessed 13 March 2020]. freeCodeCamp.org. 2020. What Exactly Is A Programming Paradigm?. [online] Available at: [Accessed 13 March 2020]. freeCodeCamp.org. 2020. What Exactly Is A Programming Paradigm?. [online] Available at: [Accessed 13 March 2020]. SearchAppArchitecture. 2020. What Is Object-Oriented Programming (OOP)? - Definition From Whatis.Com. [online] Available at: [Accessed 13 March 2020].