0% found this document useful (0 votes)
19 views

1 1 Computer Programming Concepts

1. The document discusses different computer programming concepts including programming languages, paradigms, and object-oriented programming. It covers machine language, assembly language, high-level languages, imperative, functional, logical, and object-oriented paradigms. 2. Object-oriented programming focuses on using objects that contain both data and code and can receive and send messages. Its key features are abstraction, encapsulation, inheritance, and polymorphism. 3. Advantages of object-oriented programming include reusability, division of labor, and errors being localized in objects. Classes define objects and instances are actual objects created from classes.

Uploaded by

ktetsurou19
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

1 1 Computer Programming Concepts

1. The document discusses different computer programming concepts including programming languages, paradigms, and object-oriented programming. It covers machine language, assembly language, high-level languages, imperative, functional, logical, and object-oriented paradigms. 2. Object-oriented programming focuses on using objects that contain both data and code and can receive and send messages. Its key features are abstraction, encapsulation, inheritance, and polymorphism. 3. Advantages of object-oriented programming include reusability, division of labor, and errors being localized in objects. Classes define objects and instances are actual objects created from classes.

Uploaded by

ktetsurou19
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

LECTURE LEARNING RESOURCES PREPARED BY:

ENSC 26 (1st SEM AY 2021-22) APO DWBL MCC

Module 1-1
Computer Programming Concepts

LESSON OBJECTIVES
1. Understand the different programming languages used in a computer,
2. Learn and identify the different programming paradigm and their focus,
3. Learn the different advantages and features of object-oriented programming, and

LESSON CONTENT
1. Programming Language
A computer program or program is a series of instructions written to perform a specific task for a computer. It is a series of
instructions that dictate the manner of execution of a computer. Everything done on a computer is done by using a computer program
and without programs, computers are useless. These computer programs are constructed using different programming languages.

1.1. Machine Language


Machine language is the binary code that is used by the
computer natively to perform operations. As a program, it is a set
of instructions for a specific central processing unit, that is used to
represent operations and data in a computer.
Example: 1000001 is A, 1000010 is B

1.2. Assembly Language


It is an intermediate-level computer language that is specific
to a computer architecture. It uses “English-like” abbreviations and
hexadecimal values to make complex instructions easier to write.
It is translated into machine language by another architecture
specific translator programs called assemblers.
Example: MOV AL, 61h; Load AL with 97 decimals (61 hex)

1.3. High-level Language


It is a computer language whose instructions or statements each correspond to several machine language instructions.
Instructions look like almost daily English and contain commonly used mathematical notations which made programming
significantly easier. It is translated into machine language by translator programs called compilers and interpreters.
Compilers are computer program that translates an entire set of instructions in high-level language into machine
language (Merriam-Webster), while an interpreter executes each of a set of high-level instructions before going to the next
instruction. The table below summarizes the general characteristics that differentiate compilers and interpreters.

COMPILER INTERPRETER
Relatively little time spent in analyzing and processing the
Spends lot of time analyzing and processing the program
program
Resulting executable is a form of machine-specific binary
Resulting code is sort of intermediate code
code
Computer hardware executes the resulting code Another program executes the resulting code
Program execution is fast Program execution is relatively slow

2. General Programming Paradigm


It is the various systems of ideas that have been used to guide the design of programming languages. It is a way of
conceptualizing what it means to perform computation and how tasks to be carried out on the computer should be structured and
organized. These programming paradigms are not exclusive since each paradigm has its focus.

2.1. Imperative Programming


From the word “imperatve”, which is “telling what to do.” These
paradigm recognize the fact that computers have re-usable memory
that can change state. The language provides statements, such as
assignment statements, which explicitly change the state of the
memory of the computer.
Example: Y = X + 1

2.2. Functional Programming


This paradigm emphasize the idea of computation as being about evaluating mathematical functions combined in
expressions.
Example: Y + X = 2 * X
Module 1-1 Computer Programming Concepts PREPARED BY:
ENSC 26 (1st SEM AY 2021-22) APO DWBL MCC

2.3. Logical Programming


This paradigm focuses on relation as way of expressing problems in terms of functions.

2.4. Object-oriented Programming


This focuses on the use of objects to design computer programs. Each object is capable of receiving messages,
processing data, and sending messages to other objects which have independent functions.

3. Object-oriented Programming
Object-oriented programming is a software development architecture that uses the object is built on four main facets of OOP
design: abstraction, encapsulation, inheritance, and polymorphism. It uses objects, which are code-based abstraction of a real-world
entity or relationship.

3.1 Advantages of Object-Oriented Programming


3.1.1. You don’t need to understand how they work behind the scenes.
3.1.2. You can employ several objects working at different tasks. Division of labour becomes easy.
3.1.3. Program errors become localized in objects which makes the errors easier to handle.
3.1.4. The objects are reusable.

3.2 Features of Object-Oriented Programming


3.2.1. Abstraction
• Involves the facility to define objects that represent abstract "actors" that can perform work, report on and change
their state, and “communicate" with other objects in the system.
• Basically allows roles and interaction which greatly simplify programming approach.
3.2.2. Encapsulation
• It means information hiding
• It is concealing the actual implementation/methods used by the object by
using a public interface that determines what is visible to the application
outside the class.
• Uses of encapsulation:
i. It permits the protection of attributes and methods from any
outside tampering.
ii. It allows the inclusion of validation code to help catch errors in the
use of the public interface.
iii. It frees the user from having to know (or worry about) the details
of how the properties and methods are implemented.
3.2.3. Inheritance
• The process of deriving a child class from a parent class.
• The child class inherits all of the properties, methods, and events of the parent class. It can then modify, add to, or
subtract from the parent class.
• Inheritance allows programmers to re-use code they've already written.
3.2.4. Polymorphism
• It means treating one object as another or treating an object of one class as if it were from a parent class.

3.3 Class and Instance


A class is an abstraction of a real-world concept through a source code. From
this source code or “object DNA”, instances of specific objects can be created. An
instance of an object is the actual object that you use in your program. Instances are
resultant inmemory use of a class as an object.

3.4 Object Attributes


These are pieces of data that describe the object. It can be called properties or
qualities. Examples are color, name, size, etc.

3.5 Object Methods


These defines the things that the object can do or can be done to it. Examples are click, hide, show, etc
Module 1-1 Computer Programming Concepts PREPARED BY:
ENSC 26 (1st SEM AY 2021-22) APO DWBL MCC

LESSON SUMMARY
• As technology progressed, programming languages have evolved from
machine code, to assembly language, and finally to high-level programming
language.
• Depending on the problem and purpose of the program, programming can be
approached using different paradigms, namely: imperative, functional, logical
and object-oriented.
• Among the four paradigms, object-oriented programming came to be focused
because of its hierarchical approach to application development.
• Finally, Visual BASIC, through RAD and ubiquity of the .Net Framework,
became one of the most and useful programming languages.

SELF-ASSESSMENT QUESTIONS
Identify the following concepts described.
1. Operations that an object can either perform, or have performed on it.
2. Type of programming language that are numeric codes for the operations that a particular computer can execute directly.
3. Abstraction of a computer program which consists of instructions in producing a set of outputs from a set of inputs.
4. Translator programs that convert high-level language instructions back to machine code.
5. Feature of object-oriented programming which allows programmers to share codes.

REFERENCES
Merriam-Webster. (n.d.). Compiler. In Merriam-Webster.com dictionary. Retrieved August 23, 2020, from https://www.merriam-
webster.com/dictionary/compiler

Merriam-Webster. (n.d.). Interpreter. In Merriam-Webster.com dictionary. Retrieved August 23, 2020, from https://www.merriam-
webster.com/dictionary/interpreter

Microsoft Digital Network.


Campano, Allen C. ENSC 26 Pre-Lab Handout. 2010. Engineering Science Department, CEAT, UPLB
Sanchez, PRP. (2017). ENSC 26. Retrieved from https://sites.google.com/site/ensc26prpsanchez/home

You might also like