Chapter 1 One
Chapter 1 One
Programming
Chapter One
Created by:
Mr. Hidra
Introduction to Programming language
A programming language is a language designed to communicate
instructions to a computer.
Thus, Programming language is a set of commands, strings or characters
readable by programmers but easily translatable to machine code.
It has the following
❖ Syntax: Is a set of rules that define how the commands have to be
arranged to make sense
❖ Grammar: Is a set of rules of using different punctuation, quotation
marks, semicolons,
❖ Semantics: Is a set of meanings assigned to every command of the
language and is used to properly translate the program to machine
code.
Classification of Programming language
Programming Language can be grouped into
three namely;
1)Machine Languages,
✓ BASIC,
✓ FORTRAN etc.
Attribute of good Programming Language
Some of very good characteristics of a good programming language are,
❖ Clarity, Simplicity and Unity:
❖ Orthogonality:
❖ Support for Abstraction:
❖ Programming Environment:
❖ Ease of program verification/Reusability:
❖ Portability of programs:
Program performance and features of programming
languages
Performance of a program, including
❑ Reliability,
❑ Readability,
❑ Writability,
❑ Reusability and
❑ Efficiency.
Programming Development Cycle:
The various stages in the development of a computer
program are:-
▪ Problem Definition.
▪ Program Design.
▪ Coding.
▪ Debugging.
▪ Testing.
▪ Documentation.
▪ Maintenance.
Cont..
1) Problem Definition:
In this step the problem has to be defined formally, by being sure
understanding what the program should do, that is, what the
output should be.
2) Program Design:
The next stage is the program design. The software developer
makes use of tools like algorithms and flowcharts to develop the
design of the program.
✓Algorithm.
✓Flowchart.
Cont..
3) Choose the interface: Select the objects.
Determine how the input will be obtained and how the output will be
displayed. Then create appropriate commands to allow the user to control the
program.
4) Coding:
Coding is the technical word for writing the program, by translate the
algorithm into a programming language.
For effective coding some of the guide lines which are applied are :
✓ Use of meaningful names and labels of variables,
✓ Simple and clear expressions,
✓ Making use of comments and indenting the code properly,
✓ Avoiding jumps in the program to transfer control.
Cont..
5) Debugging:
At this stage the errors in the programs are detected and corrected.
Debugging is also known as program validation.
Some common errors which might occur in the programs
include:
✓ UN initialization of variables.
✓ Reversing of order of operands.
✓ Confusion of numbers and characters.
✓ Inverting of conditions. Eg: - Jumping on zero instead of on not
zero.
Cont..
6) Testing:-
The program is tested on a number of suitable test cases.
A test plan of the program has to be done at the stage of
the program design itself.
This ensures a thorough understanding of the
specifications.
The most trivial and the most special cases should be
identified and tested.
It is always useful to include the maximum and minimum
values of all variables as test data.
Cont..
7) Complete the documentation: Organize all the material that
describes the program.
Documentation is intended to allow another person, or the programmer
at a later date, to understand the program.
Internal documentation consists of statements in the program that are
not executed, but point out the purposes of various parts of the
program.
Documentation might also consist of a detailed description of what the
program does and how to use the program (for instance, what type of
input is expected).
For commercial programs, documentation includes an instruction
manual.
Other types of documentation are the
✓Flowchart and
✓Pseudocode
Programming Tools
Tools used to convert algorithms into computer programs:
Questions…..?