Module 1 Programing
Module 1 Programing
PROGRAMMING
- is the process of creating a set of instructions that tell a computer
how to perform a task. Can be done using variety of computer
programming languages such as C++, JavaScript, Python, and many
more.
PROGRAM LOGIC FORMULATION
Elements of Programming
❑ Syntax - Refers to the rules that
define the structure of a
language, the rules that control
the structure of the symbols,
punctuation and words of
programming languages.
Elements of Programming
❑ Variable - Is a symbolic name for (or reference
to) information. The variable’s name
represents what information the variable
contains. They are called variables because the
represented information can change but the
operations on the variable remain the same.
Example: X, Y, Z or ID_NO, EMP_NAME
Elements of Programming
❑ Function - Is simply a
“chunk” of code that you
can use over and over
again, rather than writing
it out multiple times.
Example
Elements of Programming
❑ Arithmetic Operators – Arithmetic
Operators allows you to code a
programs that add, subtract, multiply
and divide.
❑ Logical Operators – To test whether
conditions
Elements of Programming
❑ Loop – Allows us to execute a statement or group of statements
multiple times and following is the general from of a loop statement
in most of the programming languages. Also an instruction that
repeats until a specified condition is reached.
Programming Design Tools
❑ Algorithm - Is a set of instructions or rules to be followed by a
computer program, which should contain an INPUT, PROCESS and an
OUTPUT depending on the problem to be solve. An algorithm is
merely the sequence of steps taken to solve a problem.
Example 1: An algorithm to add two numbers:
Take two number inputs
Add numbers using the + operator
Display the result
IPO Model