Program, Programming Language, Software, Algorithm and Flowchart
In this chapter, we will learn about programs, programming languages, generations of computer languages, software, language translators, algorithms, and flowcharts.
Program
A program is a set of instructions given to a computer to perform a specific task.
In simple words, a program tells the computer what to do and how to do it.
Programming Language
A programming language is a language used to write instructions that a computer can understand and execute.
Examples of Programming Languages
- C
- C++
- Java
- Python
- Swift
Generations of Computer Languages
Computer languages are commonly divided into five generations.
1. First Generation Language (1GL)
First-generation language uses machine code to give instructions to a computer.
Machine code consists only of binary digits:
0 and 1
It is also known as Machine-Level Language.
Example
10110100 11001010
2. Second Generation Language (2GL)
Second-generation language uses assembly language.
Assembly language uses symbolic instructions or mnemonic codes instead of binary numbers.
Examples
ADD ASUB A, BMOV A, B
Assembly language must be translated into machine language using an assembler.
3. Third Generation Language (3GL)
Third-generation languages are high-level programming languages that make programs easier to write, understand, test, and modify.
Many 3GLs follow procedural or structured programming approaches.
Examples
- C
- C++
- BASIC
- COBOL
- FORTRAN
- Pascal
4. Fourth Generation Language (4GL)
Fourth-generation languages are generally high-level and problem-oriented languages.
They require fewer instructions than traditional procedural programming languages and are commonly used for database operations, reports, and application development.
Example
- SQL
5. Fifth Generation Language (5GL)
Fifth-generation languages are associated with Artificial Intelligence (AI), logic programming, and problem-solving systems.
They are designed to allow computers to solve problems using logical conditions and constraints.
Examples
- PROLOG
- LISP
Classification of Computer Languages
Computer languages can mainly be classified into:
- Low-Level Language
- High-Level Language
1. Low-Level Language
A low-level language is a programming language that is closer to the computer’s hardware and machine language.
Low-level languages are mainly divided into:
- Machine-Level Language
- Assembly-Level Language
A. Machine-Level Language
Machine language is the language directly understood by a computer’s processor.
Programs written in machine language use binary digits (0 and 1).
Advantages of Machine Language
- Programs execute very quickly.
- It communicates directly with computer hardware.
- It does not require a translator for execution.
- Instructions can be executed directly by the computer.
Disadvantages of Machine Language
- It is very difficult to write programs.
- It is difficult to find and correct errors.
- Programs are difficult for humans to understand.
- It is machine-dependent.
- Writing large programs takes a lot of time.
B. Assembly-Level Language
Assembly language is a low-level programming language that uses symbolic codes or mnemonics instead of binary instructions.
It is also called a Second Generation Language (2GL).
Examples of Assembly Instructions
- ADD
- SUB
- MOV
Advantages of Assembly Language
- It is easier to understand than machine language.
- Programs are easier to write and modify.
- Errors are easier to identify compared with machine language.
- It is more readable than binary machine code.
Disadvantages of Assembly Language
- It is machine-dependent.
- Programs can still be difficult to understand.
- It requires an assembler to convert the program into machine language.
2. High-Level Language
A high-level language is a programming language that uses English-like words, symbols, and mathematical expressions to make programming easier for humans.
High-level languages are generally easier to write, understand, modify, and maintain.
Generations Included in High-Level Languages
- Third Generation Language (3GL)
- Fourth Generation Language (4GL)
- Fifth Generation Language (5GL)
Advantages of High-Level Languages
- They are user-friendly.
- They are easier to learn.
- Programs are easier to understand.
- Programs are easier to modify and maintain.
- They are generally machine-independent.
- Development and debugging are easier.
Disadvantages of High-Level Languages
- They require a translator to convert source code into machine code.
- They cannot communicate directly with hardware in the same way as machine language.
- Translation can add additional processing steps.
- Some high-level programs may use more system resources than equivalent low-level programs.
Types of High-Level Languages
A. Procedural / Structured Language (3GL)
Procedural languages require programmers to provide step-by-step instructions to solve a problem.
These languages are generally easier to understand, modify, and maintain than low-level languages.
Examples
- C
- C++
- Pascal
- FORTRAN
- BASIC
B. Problem-Oriented Language (4GL)
Problem-oriented languages focus more on what result is required rather than describing every individual processing step.
They are generally machine-independent and easier to use for specific types of tasks.
Example
- SQL
C. Natural / AI-Oriented Language (5GL)
Fifth-generation languages are designed mainly for Artificial Intelligence, logic programming, and expert systems.
They allow programmers to describe problems using logical relationships and constraints.
Examples
- PROLOG
- LISP
Software
Software is a collection of programs, instructions, and related data designed to perform particular tasks on a computer.
Software tells a computer what to do and how to perform a task.
Types of Software
Software can mainly be divided into:
- System Software
- Application Software
1. System Software
System software is a group of programs that manages and controls the internal operations of a computer system.
It helps control:
- Input and output devices
- Files
- Memory
- Storage devices
- Hardware resources
- Other computer operations
The main purpose of system software is to make the computer system efficient and easy to use.
Types of System Software
- Operating System
- Utility Software
- Language Translator
A. Operating System Software
An Operating System (OS) is system software that manages the overall operation of a computer.
It acts as a bridge between the user, application software, and computer hardware.
Examples
- Microsoft Windows
- Linux
- Unix
- macOS
- Android
- iOS
B. Utility Software
Utility software is system support software designed to maintain, protect, optimize, and manage a computer system.
Functions of Utility Software
- Compressing files
- Reducing file size
- Creating backups
- Recovering files
- Scanning for viruses and malware
- Managing disks and storage
- Improving system performance
Examples
- Antivirus software
- Backup utilities
- File compression tools
- Disk management utilities
C. Language Translator
A language translator is system software that converts a program written in one programming language into machine language so that the computer can execute it.
A program written by a programmer is called a source program or source code.
The translator converts the source program into machine-readable instructions.
Language translators can also help detect errors during the translation process.
Main Types of Language Translators
- Compiler
- Interpreter
- Assembler
1. Compiler
A compiler is a language translator that translates the entire high-level program into machine language before execution.
It checks the complete program and reports errors after compilation.
Examples
Compilers are commonly used with languages such as:
- C
- C++
2. Interpreter
An interpreter is a language translator that translates and executes a program one statement at a time.
If an error occurs, it normally reports the error at the corresponding statement before continuing.
Examples
Interpreters are commonly associated with languages or environments such as:
- Python
- Ruby
- BASIC
3. Assembler
An assembler is a language translator that converts a program written in assembly language into machine language.
Difference Between Compiler and Interpreter
| Compiler | Interpreter |
|---|---|
| Translates the entire program at once. | Translates one statement at a time. |
| The compiled program generally executes faster after compilation. | Execution is generally slower because translation occurs during execution. |
| Suitable for both small and large programs. | Often convenient for testing and executing programs interactively. |
| Debugging may require checking errors after compilation. | Errors can be identified statement by statement. |
| Generates translated/object code before execution in typical compiled workflows. | Usually executes translated instructions directly without creating a separate complete executable in the same way. |
| Compilation takes place before program execution. | Translation takes place during program execution. |
| C and C++ are commonly compiled languages. | Python and Ruby commonly use interpreter-based execution environments. |
2. Application Software
Application software is software designed to help users perform specific tasks.
Examples
- Microsoft Word
- Microsoft Excel
- Microsoft PowerPoint
- Adobe Photoshop
- Web browsers
- Accounting software
Types of Application Software
Application software can be broadly classified into:
- Customized or Tailored Software
- Packaged Software
A. Tailored / Customized Software
Customized software is specially developed according to the specific requirements of an individual, organization, or business.
It is designed for a particular user or purpose.
Examples
- School Management System
- Hospital Management System
- Banking Software
- Hotel Management System
- Custom Inventory Management System
B. Packaged Software
Packaged software is developed for use by many users and is designed to perform common tasks.
It is normally produced as a ready-made software product.
Examples
- Microsoft Word
- Microsoft Excel
- Microsoft PowerPoint
- Adobe Photoshop
Difference Between Program and Software
| Program | Software |
|---|---|
| A program is a set of instructions given to a computer to perform a particular task. | Software is a collection of programs and related components designed to perform one or more tasks. |
| A program is generally smaller in scope. | Software is generally larger and may contain several programs. |
| A program may be developed by one programmer or a team. | Complex software is commonly developed and maintained by a development team. |
| A program may perform a single task. | Software may provide several related features and functions. |
| Example: A C program that calculates the sum of two numbers. | Examples: Microsoft Word, Microsoft Excel, Photoshop. |
Program Design Tools
Program design tools are tools or techniques used to plan the logical structure of a program before writing the actual source code.
Two important program design tools are:
- Algorithm
- Flowchart
Algorithm
An algorithm is a finite sequence of clear and ordered steps used to solve a problem or perform a particular task.
Algorithms help programmers plan the solution before writing a computer program.
Characteristics of a Good Algorithm
A good algorithm should:
- Contain a finite number of steps.
- Have clear and unambiguous instructions.
- Be independent of a particular programming language.
- Follow a proper sequence.
- Clearly describe the input, processing, and output.
- Produce the required result.
Advantages of Algorithm
- It is easy to design using simple English statements.
- It is easy to understand.
- It is easy to modify.
- It helps programmers plan a solution before coding.
- It does not require a strict programming-language syntax.
- It helps identify logical errors before programming.
Disadvantages of Algorithm
- Writing algorithms for large and complex problems can be time-consuming.
- A detailed algorithm may become lengthy.
- Converting a complex algorithm into a working computer program may be difficult.
Example of an Algorithm
Algorithm to Add Two Numbers
Step 1: Start
Step 2: Input two numbers, X and Y
Step 3: Read X and Y
Step 4: Calculate:
Z = X + Y
Step 5: Display Z
Step 6: Stop
Flowchart
A flowchart is a graphical representation of the steps involved in solving a problem or performing a process.
It uses different standard symbols to represent different types of instructions.
The symbols are connected using flow lines or arrows to show the direction in which the process moves.
Common Flowchart Symbols
| Symbol Name | Shape | Function |
|---|---|---|
| Start / End | Oval | Represents the beginning or ending of a process. |
| Input / Output | Parallelogram | Represents input or output operations. |
| Process | Rectangle | Represents calculations or processing operations. |
| Decision | Diamond | Represents a condition or decision with different possible paths. |
| Flow Line / Arrow | Arrow | Shows the direction and sequence of operations. |
Example: Flowchart for Adding Two Numbers
The logical flow is:
Start → Input X and Y → Calculate Z = X + Y → Display Z → End
Uses of Application Software
Application software can be used in many sectors, including:
- Business
- Education
- Science
- Engineering
- Banking
- Healthcare
- Communication
- Designing
- Entertainment
A. Business Applications
Business application software is designed to help businesses perform different activities accurately and efficiently.
It can improve productivity and simplify business operations.
Examples
- Microsoft Office
- Customer Relationship Management (CRM) systems
- Accounting software
- Business Process Management systems
- E-commerce systems
- Inventory Management systems
B. Scientific Applications
Scientific application software is used for scientific research, engineering, mathematical calculations, simulations, analysis, and other technical activities.
These applications can represent real-world processes using mathematical formulas and computer simulations.
Examples
- Weather Forecasting Systems
- Navigation Systems
- AutoCAD
- Geographic Information Systems (GIS)
- MATLAB
- ORCAD
Key Points to Remember
- A program is a set of instructions given to a computer.
- A programming language is used to write computer programs.
- Computer languages are commonly classified into five generations.
- Machine language and assembly language are low-level languages.
- High-level languages are easier for humans to understand and use.
- Software is a collection of programs designed to perform tasks.
- Software is mainly divided into system software and application software.
- Compiler, interpreter, and assembler are language translators.
- An algorithm describes a solution using ordered steps.
- A flowchart represents the steps of a solution graphically.
Discussion
Share a helpful question, idea, or explanation with other students.