Computer
Programming
•It
is the
process
of giving
instructions
(commands)
to
the
computer
to
do
a meaningful
task.
•It is an
act
of teaching
the computer
on how
to
do a
task.
•The art and science of creating
instructions
for
a computer
to
follow.
•Creating a
sequence of instructions to enable
the computer to do
something.
Why
Programming?
•Computer is just a dumb machine made up of different electronic components. It is like a box which cannot do anything by itself.
•It is the
user who
tells
the computer
“what
it
has to
do?”
•If we
need our
computer to
perform
some
task,
we
first
have
to
teach
the computer
in
detail “how
it will
accomplish that task?”
•Once the
computer is taught
about a particular
task,
it will
completely
obey it but
cannot
do anything
that
it is
not
taught
to.
Programmer
•The person
who
gives
the
instructions
(commands)
to
the
computer
is
known as the programmer.
•A person
who
designs
and writes
computer
programs.
Instruction
•Instruction is any
command
given
to
the
computer.
•For
example:
1)Add
two
variables
A and
B
2)Display
result
3)Read
file
•Each of these
is the
individual instruction
to
the
computer.
Program
•Program is a
set (collection)
of
instruction to do a
meaningful
task.
•A sequence
of instructions
that are
interpreted
and executed
by
a computer. It can be
made of a single
or a hundred
of
instructions.
•For example:
In
order
to
teach
the computer on how to
calculate
average
of three
numbers?
We
need to
give
multiple
instructions
to
the
computer
to
do the
task.
Instruction 1: Get first number from the user and store it in A variable
Instruction 2: Get second number from the user and store it in B variable
Instruction 3: Get third number from the user and store it in C variable
Instruction 4: Add A, B, C and store the result in SUM variable
Instruction 5: Divide SUM by 3 and store result in AVG variable
Instruction 6: Display AVG variable
•Instructions 1-6 are
used
to
solve
a single
task.
This collection
of
instruction
is known as a program.
Comments
Post a Comment