Class 1 Class 2 Class 3 Class 4 Class 5 Class 6 Class 7 Class 8

Program Analysis – Algorithm, Flowchart & Pseudocode Notes

Program analysis is the first and most important step in programming where a problem is carefully understood and broken into simple steps before writing actual code. It helps programmers plan a clear and logical solution to a given problem.

In programming, we use different tools to represent the solution in a structured way, such as algorithm, flowchart, and pseudocode. These tools help in designing programs easily, reducing errors, and improving clarity.

Program Analysis – Algorithm, Flowchart & Pseudocode Notes

Program Analysis

Programming is the process of giving instructions to the computer to perform specific tasks like calculations, data processing and producing results. It required logical thinking and proper planning to solve problems. Before writing a program, the program must be carefully analysed and broken into simple steps. This process is called ‘program development’, which helps to create accurate and effective solutions. For the analysis, various methods are used. These methods are:

  1. Flowchart
  2. Algorithm
  3. Pseudocode

Program Development

A programme is a set of instructions given to a computer to perform a specific task. Before writing a program, the user must clearly understand the problem. The success of a programme depends on how effectively the problem is analysed and solved. Whenever a problem or requirement is to be converted into a program, the following steps are followed:

  • Problem Analysis – Understanding and defining the problem clearly.
  • Design —planning the solution using algorithms, flowcharts, or pseudocode.
  • Coding —writing the program in a programming language.
  • Testing – Checking the programme for errors and correcting them.
  • Documentation – Preparing proper records and explanations of the programme for future reference.

Problem Analysis Tools

There are various tools used for problem analysis. Problem analysis means understanding and clearly defining the problem. This understanding is expressed in a step-by-step manner, which helps in designing the solution. The following methods are commonly used:

  • Algorithm
  • Flowchart
  • Pseudocode

1. Algorithm

An algorithm is a step-by-step process of instruction used to solve a problem or complete a task. It is written in simple English language; it is not a programming language or program. It has a step where the programmes are written in an easy method, which helps the programmer to understand about the programme. For example,

To find the sum of two numbers:

  • Step 1: Start
  • Step 2: Input two numbers
  • Step 3: Add the numbers.
  • Step 4: Display the result
  • Step 5: Stop

2. Flow Chart

After preparing an algorithm for a given task, it can be presented in a pictorial form. A flowchart is a graphical representation of a process or algorithm. It uses different symbols and arrows to show the sequence of steps in solving a problem.

1. Rectangular with rounded corners, specificly use for START and STOP known as terminal.

Rectangular with rounded corners, specificly  use for START and STOP known as terminal.

2. A parallelogram represent input and output operation. It is also known as input/output symbol.

A parallelogram represent input and output operation It is also known as input and output symbol

3. A rectangle is used to represent processing or calculating part.

A rectangle is used to represent processing or calculating part

4. A diamond symbol is used to check the decision or condition.

A diamond symbol is used to check the decision or condition

5. Arrows are used to show the relationships between the shapes.

Arrows are used to show the relationships between the shapes

6. A small circle is used to connect an incomplete flowchart to its remaining part.

A small circle is used to connect an incomplete flowchart to its remaining part

Rules of drawing a flowchart

  • Every flowchart should start with a Start symbol and end with Stop symbol.
  • Always use correct symbol.
  • The flow should be start from top to bottom or left to right.
  • Arrows should be used for shosing direction of the flow.
  • Every flowchart should be one entry and one exit point.
  • Decision symbol should be two output (True of False)
  • Use connectors insted of using crossing lines.
  • Write short and clear instructions inside the symbol.

Advantages of Flowcharts

  • It makes the program planning and development easier.
  • A flowchart helps to understand the problem easily.
  • Errors and mistakes can be identified quickly.
  • Complex problems can be divided into simple steps.
  • Flowcharts act as proper documentation for future reference.
  • It saves time.
  • It represents the steps of a process in a simple graphical form.
Example: Draw a flow chart to find average of marks in % for a students of the exam.
Draw a flow chart to find average of marks in % for a students of the exam.
Example: Draw a flow chart to find the square of given number.
Draw a flow chart to find the square of given number.
Example: Draw a flow chart to find the square of numbers from 1 to 10.
Draw a flow chart to find the square of numbers from 1 to 10.
Example: Draw a flow chart to find the largest number from the given two number.
Draw a flow chart to find the largest number from the given two number.
Example: Draw a flow chart to find the factorial of “X”.
Draw a flow chart to find the factorial of

3. Pseudocode

Pseudocode is a simple way of writing the steps of a program using the English language. It helps the programmer to understand the logic of a program before writing the actual code. Pseudocode is not a programming language which does not follow any strict syntax rules.

Pseudocode is made up of the following basic logic structures:

  • Sequence
  • Selection
  • Iteration
Advantages of pseudocode
  • Pseudocode is an easy method to read and understand.
  • Pseudocode does not follow strict programming syntax rules.
  • It helps to easily convert pseudocode into an actual programming language.
  • It helps in finding errors before coding starts.
  • Complex programmes can be divided into simple steps.
  • It saves time during program development.
Limitations of pseudocode
  • Pseudocode does not follow any rules.
  • Different programmers may write pseudocode in different ways.
  • It cannot be executed or compiled by a computer.
  • Sometimes it can create confusion due to lack of proper syntax.
  • For complex programs, it can be lengthy.
  • It is less useful for visual representation compared to flowcharts.

Programming Techniques

There are two basic techniques used in programming.

  • Structured programming
  • Modular programming

1. Structured programming

In this programming method, the program is developed in a hierarchy method where the main program is at the top and subprograms will be at the bottom. A structured program is a way of writing a program where programs are clear, logical and easy to understand, test and maintain easily. In this technique three basic structures are normally adopted, such as:

  • Simple Sequence – Statements are executed one after another in order.
  • Selection (Decision) – A decision is taken using conditions such as if-else.
  • Repetition (Looping) – A set of statements is repeated until a condition is satisfied.

2. Modular Programming

Modular programming is a programming method where the large program is divided into small and independent parts called modules. Each module performs specific tasks. Modular programming makes the program easier to understand, manage, debug and reuse. In the “C” language modular programming is more popular. Each module is called a subroutine.

Searching

To find any record from the items we use the searching method. For searching there are various algorithmsitems, available:

  • Linear search
  • Binary search

1. Linear Search

If “N” items are given and you want to find whether they are present in a list or array or not. In this method each element is checked one by one from the beginning.

Algorithm of Linear Search

  • Step 1: Start
  • Step 2: Read N items and the search element X.
  • Step 3: Compare X with each item one by one.
  • Step 4: If X is found, display “Element Found”.
  • Step 5: Otherwise, display “Element Not Found”.
  • Step 6: Stop

2. Binary Search

In binary search technique isThe used to find an element in a sorted list or array. It works by repeatedly dividing the list into two halves until the required element is found.

Steps of Binary Search

  • Find the middle element of the list.
  • Compare the middle element with the search element.
  • If both are equal, the element is found.
  • If the search element is smaller, search in the left half.
  • If the search element is greater, search in the right half.
  • Repeat the process until the element is found or the list ends.

Algorithm of Binary Search

  • Step 1: Start
  • Step 2: Read N sorted items and search for element X
  • Step 3: Find the middle element
  • Step 4: If middle = X, display “found”.
  • Step 5: If X is smaller, search the left half.
  • Step 6: If X is greater, search the right half.
  • Step 7: Repeat until found or the list ends.
  • Step 8: Stop

Sorting

Sorting is a method of arranging the data items in ascending or descending order. To arrange the element in the array or list, the following sorting method can be used.

  • Sorting by selection
  • Bubble sorting
  • Shell sorting
  • Heap sorting

1. Bubble sorting

Bubble sort is the simplest sorting method. In this method, adjacent elements are compared and swapped if they are in the wrong order. This process is used repeatedly until the list becomes sorted.

Algorithm of Bubble sort

  • Step 1: Start
  • Step 2: Read N elements
  • Step 3: Compare adjacent elements
  • Step 4: Swap if elements are in the wrong order.
  • Step 5: Repeat until all elements are sorted.
  • Step 6: Display the sorted list
  • Step 7: Stop

Disclaimer: We have provide you with the accurate handout of “Program Analysis – Algorithm, Flowchart & Pseudocode Notes“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above study material present on our websites is for education purpose, not our copyrights.

Images and content shown above are the property of individual organisations and are used here for reference purposes only. To make it easy to understand, some of the content and images are generated by AI and cross-checked by the teachers.

cbseskilleducation.com

Leave a Comment