Program Analysis Fycs
Program Analysis Fycs
Program Analysis
Programming is the software concept where it is the playback of
computer job, computer person should be perfect in the
programming. The results of any computer job,printout, layput,
results, data processing. All works are basically depends upon the
programming technique and accuracy of programming.Your
program tells computer to do particular job in desired manner.
Program development is not so simple it requires number of
systematic working steps to make it simple and perfect. Program
development is a skill, it requires logic. Any problem, which is to
be computerised, must be properly analysed and organised. It is
to be always planned because computer is very precious and one
cant afford computer by experimentally on methods of problem
solving.
Any problem,which has to be converted in computer program,
must be carefully analysed. Program analysis consisys in finding
or deriving the procedural steps involved in getting the solution to
a problem. That step must come within the computer capabilities.
e.g Problem statement
add 2 numbers and display the result
1.
2.
3.
4.
Page 1
Program Development
Program is a list of instructions in specific language to tell the
computer to do the job in sequence. Before writing a program
user has to define problem. Problem is first analyzed. Actually
problem solution gets converted into program. But for
conversation there is process of programming. Programming is a
process for development of program, for a specific problem.
Whenever problem has to be converted in to a program, then oits
process has following steps :
1.
2.
3.
4.
5.
Problem analysis
Design
Coding
Testing
Documentation
1. Problem analysis
You should have complete definition of problem and the
requirements should be clear before writing the solution.
Generally every program needs input, output, storage and
process.
2. Design
A business function when implemented in a computer system is
termed as a program. Before a program is developed, it must be
designed. Program developers use tools such as pseudocode, flow
chart, and hierarchy chart to design
programs.
3. Coding
After a program is designed, it is implemented. A program code is
a set of instructions developed by a programmer to carry out the
business functionality in a particular language such as VB, C#,
Java, ASP, etc.
4. Testing
As the program is being coded, and after the code is completed it
must be tested to see that program is running properly and it
produces required outputs with appropriate input data.
Nirmala Memorial Foundation college of Commerce and Science
Page 2
5. Documentation
As a program is being coded, and after the coding is
completed, the developers should document the program.
Documenting a program means writing down some instruction for
the users, the purpose of the program, the
way it performs the tasks, the inputs and the outputs expected.
Once each program or sub-program is documented, it is
necessary to create documentation for the whole business
information system.
b) Flowchart
Nirmala Memorial Foundation college of Commerce and Science
Page 3
Flow Line
Flow line connectors show the direction
(Arrow,
that the process flows.
Connector)
Terminators show the start and stop
Terminator points in a process. When used as a Start
(Terminal
symbol, terminators depict a trigger
Point, Oval) action that sets the process flow into
motion.
Decision
Page 4
c)
Pseu
do
code
:
It is a programming analysis tool used for planning program logic.
Pseudo meand false and code refers to the instruction written in
Nirmala Memorial Foundation college of Commerce and Science
Page 5
Page 6
Page 7
Page 8
Step-by-step example
Let us take the array of numbers "5 1 4 2 8", and sort the array
from lowest number to greatest number using bubble sort. In
each step, elements written in bold are being compared. Three
passes will be required.
First Pass:
(51428)
( 1 5 4 2 8 ), Here, algorithm compares the first
two elements, and swaps since 5 > 1.
(15428)
( 1 4 5 2 8 ), Swap since 5 > 4
(14528)
( 1 4 2 5 8 ), Swap since 5 > 2
(14258)
( 1 4 2 5 8 ), Now, since these elements are
already in order (8 > 5), algorithm does not swap them.
Second Pass:
(14258)
(14258)
(14258)
( 1 2 4 5 8 ), Swap since 4 > 2
(12458)
(12458)
Nirmala Memorial Foundation college of Commerce and Science
Page 9
(12458)
(12458)
Now, the array is already sorted, but the algorithm does not know
if it is completed. The algorithm needs one whole pass
without any swap to know it is sorted.
Third Pass:
(12458)
(12458)
(12458)
(12458)
(12458)
(12458)
(12458)
(12458)
Disadvantages:
It's the slowest type of sort... Imagine comparing and swapping a
list of 300 elements, analyzing pair by pair. The process gets
long!
Experts advise against the use of the bubble sort for repetitive
sorts or sorts that contain more than a few hundred objects.
Page 10