2.
PROGRAM ANALYSIS
Q2. What are the steps involved in program development? Explain In brief.
ANS-
Steps Involved in Program Development:
1) Problem Analysis: Understand the problem and its requirements
clearly before proceeding.
2) Design: Divide the solution plan into smaller modules and design
each module separately.
3) Coding: Convert the designed program into a programming language.
4) Testing: Test the program for correct execution and fix any errors
found.
5) Documentation: Maintain written information about the program for
developers and users.
Each step is crucial in ensuring a successful program development
process.
Q3. What are various symbols used while drawing flow chart? Explain it
ANS-
Various Symbols Used in Flow Charts:
1) Terminal Symbol: Represented by a rectangular shape with rounded
corners, used to indicate the start and stop points of a program.
2) Input/Output Symbol: Represented by a parallelogram, used to show
input and output operations such as keyboard entry and printing.
3) Processing Symbol: Represented by a rectangle, used to depict
processing or calculating parts of the program.
4) Decision Box: Represented by a diamond symbol, used for
decision-making steps in the form of questions and logical answers.
5) Arrows: Used to indicate the direction of flow of program process.
6) Connector: Represented by a small circle, used to connect
incomplete flow charts to their remaining parts or where flow lines
cross each other.
Q4. Define and Explain algorithm concept with suitable example.
ANS-
1) Algorithm Definition:
An algorithm is a logical sequence of steps designed to solve a specific
problem. It is a set of instructions written in simple language to guide the
programmer in developing a program efficiently.
2) Example of Algorithm:
Algorithm to exchange the value of two variables.
Suppose if A and B are the two variables
Algorithm:
1) Store the value of A in X
2) Transfer B value to A
3) Transfer X to B
Q5. What are the characteristics of algorithm?
ANS-
An efficient algorithm should have the following characteristics:
1) It should be easy and simple in language.
2) It should not repeat the task again and again.
3) Every step must be accurate and complete in itself.
4) It can be easily modified if necessary.
5) It should be easily understandable to others and steps should be clear
and concise.
6) It should be economical in the use of computer time, computer storage
and peripherals.
7) It should be correct for clearly defined situations.
Q6. Define flowchart and write the advantage of flowchart.
ANS-
Flowchart Definition:
A flowchart is a pictorial representation of a program's logic using standard
symbols to illustrate the sequence of steps in the program execution.
Advantages of Flowchart:
1) Better programming steps.
2) Systematic analysis.
3) Effective testing and results.
4) Universal logical solution.
5) Minimum length.
6) Minimization of errors.
7) Easy coding.
Q7. Explain Following Term: (a) Sorting (b) Psedocode
ANS-
(A) Sorting
● Sorting is the process of arranging data items in either ascending or
descending order.
● Various sorting algorithms are used to arrange elements in ascending
or descending order in an array, list, or any data structure.
(B) Pseudocode
● Pseudocode is a programming analysis tool used for planning
program logic.
● It is an imitation of actual computer instructions, made up of basic
logic structures like sequence, selection, and iteration.
Q8. What is difference between modular programming and structured
programming?
ANS-
Modular Programming:
● In modular programming, the program is divided into separate
modules or subprograms.
● Each module performs a specific task and can be called as needed
within the main program.
Structured Programming:
● Structured programming involves developing the program in a
hierarchical manner with modules referring to subprograms.
● It follows a top-to-bottom approach and uses basic structures like
sequence, selection, and repetition.
Q9. What is sorting? State various algorithms used for it.
ANS-
Sorting is the process of arranging data items in either ascending or
descending order. Various algorithms are used for sorting, including:
1. Sorting by Selection
2. Bubble Sorting
3. Shell Sorting
4. Heap Sorting
Q10. What is binary searching? Explain it
ANS-
It is a simple method to search a sorted list. We assume that elements are
arranged in ascending order. Procedure is as follows,
1) Calculate position of mid point element.
2) Compare value of mid point element with the number. If desired value is
less than the value of mid point element then reduce the search in second
half considering mid point of the interval.
3) Repeat the search if interval is not empty.
4) On successful search, position is printed.
In order to narrow down search, binary searclı is used.
While using this searching method array should be sorted in increasing
numerical order
Q11. Explain whole programming process in brief.
ANS-
Programming Process Steps:-
1. Problem Analysis: Understand and define the problem to be solved
by the program, including input, output, storage, and process
requirements.
2. Design: Divide the solution plan into modules and design each
module separately, following structured or object-oriented
programming methods.
3. Coding: Convert the program design into a programming language by
writing the actual code.
4. Testing: Test the program to ensure it executes correctly, identify and
correct any errors, and verify its functionality.
5. Documentation: Maintain written information about the program for
developers and users, including developer's documentation and
user's documentation.
NOTE —
FOR FLOW CHART AND ALGORITHM EXAMPLES
REFER TO TEXTBOOK EXAMPLES.