You are on page 1of 10

CFP 122

Computer Fundamentals
Programming Using
Dev C++
By: Hilene E. Hernandez, MIT
Chapter 1
The Concept of Computer Programming
Computer programming
(often shortened to programming or coding)

is the process of designing, writing, testing,


debugging, and maintaining the source code
known as computer programs. A computer
program is a set of instructions used to operate
a computer to produce specific result. Another
term for computer program is software.
Brief History of Programming
Language
Language

Computer uses two symbols (0 and 1) to represent


data, information and instructions. This language
is called machine language (low level language).

Since it is difficult for human beings to use the


machine language, high level languages are
invented.
Machine Language (ML)

Sometimes referred to as machine


code or object code, machine
language is a collection of binary
digits or bits that the computer reads
and interprets. Machine language is
the only language a computer is
capable of understanding.
Assembly Language (AL)

An assembly language is a low-level


programming language for computers,
microprocessors, microcontrollers, and other
programmable devices.

Thus, an assembly language is specific to certain


physical (or virtual) computer architecture. This is
in contrast to most high-level programming
languages, which, ideally, are portable.
High Level Language (HLL)

 An English-like computer instruction that can


be used easily by human beings in program
coding.
 E.g.: C, Pascal, Java, COBOL, etc.
 HLL is independent on the hardware.
 A translator is needed to convert a program

written in a HLL to the low level language.


There are two types of translator namely:
compiler and interpreter.
Compiler and Interpreter
 Compiler: Converts the entire program
from high level to machine level.
 E.g. C compilers like cc, gcc

 Interpreter: Converts a line of


instruction into machine language and
executes it, then goes to the next
instruction.
 E.g. Shell is a command interpreter.
Algorithms and Procedures

 Algorithm is a step by step sequence


of instructions that describe how to
perform a computation. These
instructions are not a computer
program. Unlike a program, which
must be written in a language the
computer can respond to, an
algorithm can be written in English-
like term.
Example of Algorithm
 1. Start
 2. Enter the three integers; let

us call them N1, N2 & N3


 3. Compute the Sum of N1, N2

& N3, and then divide them by


 4. Display the Average Value
 5. Stop
Algorithms
 Activity No. 1
Give the algorithms of the following:
a. How do you qualify for DHVSU admission?
b. How do we to order goods with Lazada or
Shopee?
c. How do you cook your favorite pasta
recipe?
d. How can you go to an unfamiliar tourists
destination?

You might also like