Programming Methodology
Programming methodology means the proper way of solving a problem using
logical steps, diagrams, and coding.
It generally involves:
1. Algorithm
2. Flowchart
3. Pseudo Code
4. Programming Language
5. Error Handling
Algorithm
Definition: An algorithm is a step-by-step written procedure to solve any problem.
Characteristics of a good algorithm:
1. Simple and clear
2. Step-by-step process
3. Must produce correct output
4. Should end after finite steps
Example: Find whether a number is Even or Odd
Algorithm:
1. Start
2. Take a number (say n)
3. Divide the number by 2
4. If remainder = 0 → Number is Even
5. Else → Number is Odd
6. Stop
Flowchart
Definition: A flowchart is a graphical representation of an algorithm.
It uses symbols to represent different steps.
Common Flowchart Symbols
1. Oval / Rounded Rectangle → Start / End / Halt
2. Rectangle → Process / Calculation step
3. Diamond (Rhombus) → Decision / Condition checking
4. Parallelogram → Input / Output
5. Display Symbol → Showing output on screen
6. Flow lines (arrows) → Indicate the direction of data flow
7. Database symbol → Secondary storage (like HDD)
8. Magnetic tape symbol → Sequential storage
9. Annotation symbol → For comments/documentation
10. Page Connector (On-page / Off-page) → To connect flow across same or
different pages
4. Pseudo Code
Definition: Pseudo code is a simple representation of program logic written in plain
English (sometimes mixed with programming keywords).
It is not actual programming language but helps in writing the final code.
Example:
n = 33
Divide n by 2
If remainder = 0 then
Print “Even”
Else
Print “Odd”
Errors in Programming
When writing programs, mistakes are called errors (bugs).
The process of finding and fixing them is called Debugging.
Types of errors that can occur:
1. Syntax Error
Violation of programming language rules.
Detected at compile time.
Example:
if (a=5 // Missing bracket → Syntax Error
2. Semantic Error
Wrong word arrangement or wrong statement meaning.
Example:
Cricket plays Ram (Wrong arrangement)
Ram plays Cricket (Correct)
3. Logical Error
Error in program logic (wrong output even though program runs).
Example:
a = b + c (Correct)
b + c = a (Logical error)
4. Runtime Error
Occurs while program is running.
Program stops abnormally or gives unexpected results.
Examples:
Division by zero
Infinite loop (while(1))
Important Terms
Bug → Error in a program.
Debugging → Process of detecting and removing errors.
Compiler Error → Errors shown at the time of compilation.
Infinite Loop → Sequence of instructions that repeats endlessly.
5. Programming Language
After algorithm, flowchart, and pseudo code, the next step is to write the actual
program using a programming language.
Examples: C, C++, Java, Python, etc.
Types of Programming Languages
(A) Machine Language
Also called Low-Level Language.
Written in binary form (0 and 1).
It is the only language directly understood by computer hardware.
Machine dependent (not portable).
Directly understood by computer.
Very difficult to write.
Example: 10110101
(B) Assembly Language
Uses mnemonics (symbolic codes) instead of binary numbers.
Example: ADD A, B instead of 100110.
Easier than machine language but still machine dependent.
Requires an Assembler (to convert assembly code into machine code).
(C) High-Level Languages (HLL)
Close to human language (English-like).
Portable → can run on different machines.
Easier to learn and use.
Requires a Compiler or Interpreter to convert into machine code.
Examples: C, C++, Java, Python, FORTRAN
2. Object-Oriented Programming System (OOPS)
A type of High-Level Language.
Concept introduced in SIMULA-67 (first OOPS language).
Based on 4 pillars:
1. Encapsulation – Wrapping data and functions together.
2. Inheritance – Reusing code from existing classes.
3. Polymorphism – One function, many forms.
4. Abstraction – Hiding details, showing only essentials.
Examples of OOPS Languages: C++, Java, C#, Python, Ruby.
Important High-Level Languages
1. FORTRAN (Formula Translation)
World’s first High-Level Language.
Used for mathematics & scientific work.
2. COBOL (Common Business Oriented Language)
Designed for business applications.
3. BASIC (Beginners’ All-purpose Symbolic Instruction Code)
Easy to learn, popular for micro-computers.
4. PASCAL
Simple and easy to learn.
Used in teaching programming concepts.
5. C Language
Known as the Mother of all Languages.
Developed by Dennis Ritchie at AT&T Bell Labs (with Ken Thompson).
Used in development of UNIX Operating System.
6. C++
Developed by Bjarne Stroustrup.
Extension of C language with OOPS features.
7. Java
Object-Oriented Language.
Mostly used for web applications and Android development.
8. JavaScript
Scripting language for interactive web pages.
9. Python
Easy to learn, powerful language.
Widely used in Artificial Intelligence (AI), Machine Learning, and Data Science.
10. Ruby
Object-Oriented language, popular for web applications.
11. Perl
Scripting language, used for text processing.
12. Prolog
Used in AI and logic programming.
13. LISP (List Processing)
Oldest AI-based programming language.
14. ALGOL
Early structured programming language.
15. Ada
Named after Lady Augusta Ada Lovelace (first computer programmer).
16. R Language
Latest popular language.
Used in statistical computing and data analysis.
Languages for Web Development
HTML (Hypertext Markup Language) → For creating web pages. (Not a
programming language)
CSS (Cascading Style Sheets) → Used with HTML for page design.
XML (Extensible Markup Language) → For structured data storage.
PHP, ASP.Net, C# → For server-side web programming.