IC Module 5 PT1 Programming Fundamentals
IC Module 5 PT1 Programming Fundamentals
ii
Quick Contents:
Preface 1
Overview 2
What is a computer program? 2
Introduction to Computer Programming 4
Uses of Computer Programs 7
Computer Programmer 7
Algorithm 8
How a Program Works? 9
1
PREFACE
Computer Programming
Overview
Before getting into computer programming, let us first understand
computer programs and what they do.
You will use Human Language to tell the way to go to that restaurant,
something as follows:
Here, you have used English Language to give several steps to be taken to
reach the restaurant. If they are followed in the following sequence, then
you will reach the restaurant:
1. Go straight
2. Drive half kilometer
3. Take left
4. Drive around one kilometer
5. Search for restaurant your right side
Now, try to map the situation with a computer program. The above
sequence of instructions is actually a Human Program written in English
Language, which instructs on how to reach a restaurant from a given
starting point. This same sequence could have been given in Spanish, Hindi,
Arabic, or any other human language, provided the person seeking
direction knows any of these languages.
Levels of Language
Programming languages are said to be "lower" or "higher," depending on
how close they are to the language the computer itself uses (Os and 1s =
low) or to the language people use (more English-like-high). We will
consider five levels of language. They are numbered 1 through 5 to
correspond to levels, or generations. In terms of ease of use and
capabilities, each generation is an improvement over its predecessors.
5
Today computer programs are being used in almost every field, household,
agriculture, medical, entertainment, defense, communication, etc. Listed
below are a few applications of computer programs:
COMPUTER PROGRAMMER
Someone who can write computer programs or in other words, someone
who can do computer programming is called a Computer Programmer.
Based on computer programming language expertise, we can name a
computer programmer as follows:
8
C Programmer
C++ Programmer
Java Programmer
Python Programmer
Pascal Programmer
Java Programmer
Ruby Programmer
ALGORITHM
From programming point of view, an algorithm is a step-by-step procedure
to resolve any problem. An algorithm is an effective method expressed as
a finite set of well-defined instructions.
As you can see from this list, the CPU performs simple operations on
pieces of data. The CPU does nothing on its own, however. It has to be told
what to do, and that’s the purpose of a program. A program is nothing
more than a list of instructions that cause the CPU to perform operations.
Each instruction in a program is a command that tells the CPU to perform
a specific operation. Here’s an example of an instruction that might appear
in a program:
10110000
To you and me, this is only a series of 0s and 1s. To a CPU, however, this is
an instruction to perform an operation. It is written in 0s and 1s because
CPUs only understand instructions that are written in machine language,
and machine language instructions always have an underlying binary
structure.