Please enable JavaScript.
Coggle requires JavaScript to display documents.
INTRODUCTION TO THE PROGRAMMING - Coggle Diagram
INTRODUCTION TO THE PROGRAMMING
Language C
What is C programming?
• C is a powerful language.
• C is a structured programming language.
• C supports functions that enables easy maintainability of code, by breaking large file into smaller modules. • C programming is a special language decided to instruct a computer to do certain task.
• It uses a simple everyday-like- English abbreviation code for easy understanding by programmer
Background of C programing
The C language was first developed in 1972 by Danny Ritchie at AT & T Bell Labs. C is high level programming language and the most popular general purpose programming language. C is written as a series of functions that call each other for processing.
Even the body of the program is a function named “ main.”
The function is very flexible, allowing programmers to choose from the standard library that comes with the compiler to use third party programming
The compiler and execute programs
A programmer uses a text editor to create or modify files containing C code.
Code is also known as source code.
After a C source file has been created, the programmer must invoke the C compiler before the program can be executed(run)
Used to check the Programs for Errors
Compiler creates a object file if there is no error in the Source Code
A file containing source code is called a source file.
DEFINITION AND TYPES OF PROGRAMMING
Program
A set of step-by-step instructions that directs a computer to perform a specific task and to produce the required results.
Programmer
Programmer is a person who writes the program.
Programming
Programming is a process of designing/ creating a program.
The various types of programming
languages.
Low-level languages
Assembly language
Advantages
Debugging is very easy when compared to machine language.
It is easy for programmers to remember the alphanumeric codes than the binary codes.
i) It is easier to understand and use as compared to machine language.
ii)It is easy to locate and correct errors.
Disadvantages:
iii) It is modified easily
The major disadvantage is that, it is machine dependent.
Like machine language it is also machine dependent.
Since it is machine dependent therefore programmer Should have the knowledge of the hardware also.
Uses symbolic instructions (mnemonics) to represent the instructions in the programs
Machine language
Language that computers can understand
Instructions in this language are in the form of 1s and 0s
Advantages of Machine Language
i) It makes fast and efficient use of the computer.
ii) It requires no translator to translate the code i.e.Directly understood by the computer.The computer processes the instructions in machine language very quickly
Disadvantages of Machine Language:
i) All operation codes have to be remembered
ii) All memory addresses have to be remembered
iv) These languages are machine dependent i.e. a particular
v)Machine language can be used on only one type of computer
vi)Programmers must have knowledge of the machine hardware and its configuration.
vii)Programmer needs to remember a number of binary code to write machine language programs.
iii) It is hard to amend or find errors in a program written
viii)Machine language programs are very difficult to debug.
High-level languages
High level computer languages give formats close to English language and the purpose of developing high
level languages is to enable people to write programs easily and in their own native language environment
Languages that use English words and mathematical symbols for writing programs
(English).
C, C++, Java, Visual Basic, Fortran, MySQL,
User-friendly
Advantages
Similar to English with vocabulary of words and symbols
They require less time to write.
Disadvantages of High Level Language
A high-level language has to be translated into the machine language by a translator and thus a price in computer time is paid.
The object code generated by a translator might be inefficient Compared to an equivalent assembly language program
Types of computer languages
Similarly to communicate with the computers we have to use specific languages and for this.
The program is easy to read
The program is easy to maintain
The program is easy to port around on different computer platforms
Types of Programmme
structured programming
Programming methodology in which the instructions are written in a sequence.
The structured program is viewed as a series of task to be done,such as reading data,
processing data and generating report or
output
The main program fragmented into smaller functions which are then arranged in
an hierarchical structure
modular programming
Programming methodology in which the complex program is broken into number
of simple modules.
A module is an independent segment of the program that performs a specific task.
When compared to structured programming, writing and debugging modular programs are easy
It does not allow data to move freely through the system. Instead, it binds the data to the functions that areneeded to manipulate them.
Programming methodology in which the data and the code are treated as a single unit
object-oriented programming
This is to protect the data from accidental modifications by external functions to an object.
THE ALGORITHM, FLOWCHART AND PSEUDOCODE
Algorithm a sequence of instructions to solve a problem,writeen in human language.
Better Programming
Easy testing and Debugging
Efficient Coding
used to analyze problems.
used to develop the logic to solve problems
Instructions in a flowchart are represented using different symbols
Flowchart a graphical representation of the sequence of operations in an information system or program
Pseudo code steps in problem solving that is writeen half in programming code and half in human language.
Pseudo code is also known as Program Design Language
Pseudo code emphasizes on Design It is an outline of program that can be converted into programming instruction.
Pseudo code instructions are written in the order or sequence logic to be performed.
Advantage
Drawing a flowchart is a time-consuming process
It is very difficult to draw the flowchart for programs that contain complex branches and loops
The amount of details that a flowchart should represent is not standardized.
Disadvantages
It is easier to modify the pseudo code compare to modifying
flowcharts
The time taken to write pseudo code is less compared to drawing a flowchart.
It enables even a non-programmer to understand the working of programs.
Advantages
Disadvantages
No standard rules are followed for writing pseudo code. Each programmer might use a different style for writing a pseudo codes
It is difficult for beginners to write pseudo code compared to drawing flowcharts
ANALYZE PROBLEM WITH
SEQUENCE STRUCTURE
Sequence Structure
In sequence structure, all the instructions in
the program must run one after another.
There is no skipping of any instruction; no
task is skipped in the sequence.
The instructions are executed one by
one, or in sequence
Next figure will shows the flowchart for
sequential execution of instructions
Looping Structure
In looping structure, a set of instructions is executed several times based on certain conditions.
The next figure will shows the flowchart for
looping structure.
Selection Structure
Based on condition, only one of the two tasks will
be executed.
Next figure will shows the flowchart for selection
structure
In the selection structure, the instructions are executed based on the answer for a stated condition