What is a Computer Program?
A computer program is a sequence of instructions written using a Computer Programming
Language to perform a specified task by the computer.
The two important terms that we have used:
Sequence of instructions
Sometimes also called as program codes. Usually written in English as commands that the
computer performs.
Computer Programming Language
Application software’s purposely used to write computer programs (ei. Java, VB, Python, C++,
etc).
A computer program is also called a computer software, which can range from two lines to millions
of lines of instructions.
Computer program instructions are also called program source code and computer programming is
also called program coding.
The Computer Programmer - Someone who can write computer programs or someone who can
do computer programming.
Algorithm - an algorithm is a step-by-step procedure to resolve any problem.
Basic Elements of any Programming Language
Programming Environment Basic Operators
Decision Making Data Types
Loops Keywords
Arrays Variables
Functions Basic Syntax
Programming Environment - It simply implies a base on top of which we can do our
programming.
# Example of programming environment includes Integrated Development Environment
(IDE), text editors, Text Development Environment, etc.
Syntax - It refers to the rules that specify the correct combined sequence of symbols that can
be used to form a correctly structured program using a given programming language.
An error in the use of syntax is called a syntax error.
Data Types - A data type represents a type of the data which you can process using your
computer program. It can be numeric, alphanumeric, decimal, etc.
Variables - Variables are the names you give to computer memory locations which are used
to store values in a computer program.
Keywords - A keyword is a word that is reserved by a program because the word has a
special meaning. Keywords can be commands or parameters.
Keywords are sometimes called reserved names.
Basic Operators - An operator in a programming language is a symbol that tells the compiler
or interpreter to perform specific mathematical, relational or logical operation and produce
final result.
Decision Making - Decision making is about deciding the order of execution of statements
based on certain conditions or repeat a group of statements until certain specified conditions
are met.
Loops - The concept of loop is used to execute one or more statements up to a desired
number of times.
Arrays - An array is a data structure, which can store a fixed-size collection of elements of the
same data type.
Functions - A function is a block of organized, reusable code that is used to perform a single,
related action.
Two types of functions:
1. Built-in functions
2. User-defined functions
What is a Compiler?
You write your computer program using your favorite programming language and save it in a
text file called the program file or a source code.
What is an Interpreter?
It is a function that directly executes encoded logic
Programming Styles
Computer programmers, over time, used and have developed expertise to write
computer programs through various style.
These styles include:
1. Functional Programming
2. Modular Programming
3. Object-Oriented Programming
Functional Programming
Functional programming is a style of programming that emphasizes the evaluation of expressions
rather than the execution of commands.
Modular Programming
A module, in modular programming, is a series of functions (or procedures) that are related
in some way.
A module is a set of functions (actions) that are related to each other
Object-Oriented Programming - OOP is organized around objects rather than actions.
Normally, a program has a simple flow:
input data,
process the data and
output a result.