WHAT IS COMPUTER:
A computer is a machine that can be programmed to carry out sequences
of arithmetic or logical operations automatically. Modern digital electronic
computers can perform generic sets of operations known as programs. These
programs enable computers to perform a wide range of tasks.
PARTS OF COMPUTER HARDWARE:
Central processing unit Hard drive
Storage Computer case
Keyboard Ram
Computer monitor Printer
Grapics card Sound card
PORTFOLIO
IN
CPT 112
COMPUTER PROGRAMMING
TECHNOLOGY
1
SUBMITTED BY: _____________________
Student
SUBMITTED TO: _____________________
Instructor
NAME OF CPU PORTS:
There are different types of ports available:
Serial port. Audio ports
Parallel port. Hdmi
USB port. Thunderbolt
PS/2 port. Ethernet
VGA port. Dvi
Modem port. Micro usb
FireWire Port.
Sockets.
HISTORY OF PROGRAMMING LANGUAGES
The first computer programming language was created in
1883, when a woman named Ada Lovelace worked with Charles
Babbage on his very early mechanical computer, the Analytical Engine.
WHAT IS ALGORITHM:
An algorithm is a procedure used for solving a problem or
performing a computation. Algorithms act as an exact list of instructions
that conduct specified actions step by step in either hardware- or software-
based routines
Algorithms are widely used throughout all areas of IT. In
mathematics, computer programming and computer science, an algorithm
usually refers to a small procedure that solves a recurrent problem.
Algorithms are also used as specifications for performing data processing
and play a major role in automated systems.
An algorithm could be used for sorting sets of numbers or for more
complicated tasks, such as recommending user content on social media
Algorithms typically start with initial input and instructions that describe a
specific computation. When the computation is executed, the process
produces an output.
CHARACTERISTICS OF ALGORITHM:
Algorithm are organized and follow a logical order
Ex. 0-9. 0 is the start and the 9 is the end
Algorithm have clear instructions
Ex. Alphabet. Start A End Z. Sorting of letters
Algorithm have realistic or visible instruction
Algorithm solved a problem or produced a result
Ex. Problem: Compute the number 1, 2, 3
Step 1: Add all the numbers together.
Step 2. Sum of 1+2+3
Step 3. Ans=6
Algorithm always end in a given amount of time
Ex. Print all even intergers /number.
Step 1. Print the number 2
Step 2. Print the number 4
Step 3. Print the number 6
METHODS OF WRITING ALGORITHM:
1) STEPPING - Is a method where all instructions follow each other in a
particular order to solve the problem. Example: Problem: To compute the
sum of number 1 to 3
Algorithm:
Step 1: Add all the numbers 1 to 3
Step 2: Sum of 1+2+3
Step 3: Ans=6
1. ) LOOPING -consist of instruction that are reported a number of times to
get a resolution there are different types of loops repeat until, While and
FOR.
REPEAT UNTIL- this is a loop that carries out instructions repeatedly and
stop when given the Until command.
Example: Problem: To wash the glass window.
Algorithm:
Step 1: REPEAT
Step 2: Wash with water
Step 3: Until the window is clean
• WHILE -is a loop where instructions are carried out while the condition is
TRUE otherwise the loops indicated END WHILE statement.
Example: Problem: To ask for a number less than 5, then stop when such
a number is given.
Algorithm:
Step 1: WHILE number given is less than 5
Step 2: ask for a number less than 5
Step 3: END WHILE
• FOR LOOP- This a loop that keeps on carrying out command or
commands, for a given number of times in this type of loop that number of
times the instructions are repeated must be declared. The instructions to be
repeated are placed in between the FOR And END FOR commands.
Example: Problem: To print the number from 1 to 10
Algorithm:
Step 1: FOR number = 1 to 10
Step 2: Print number
Step 3: END FOR
2. ) Choosing or Selection - Method is used is the problem requires
decision making. Example: Problem: To decide to go home.
Algorithm:
step 1: IF the time is 5pm or later than 5pm
Step 2: THEN go home
Step 3.