0% found this document useful (0 votes)
101 views

Flow Chart:-: Characteristics of An Algorithm

This document discusses computer programs, algorithms, flowcharts, programming languages, and generations of programming languages. It provides definitions and examples of: - A computer program and how it is written using a programming language. - The characteristics of an algorithm and examples of algorithms and corresponding flowcharts. - The different generations of programming languages from machine language to high-level languages to problem-oriented languages.

Uploaded by

Joshua Fleming
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views

Flow Chart:-: Characteristics of An Algorithm

This document discusses computer programs, algorithms, flowcharts, programming languages, and generations of programming languages. It provides definitions and examples of: - A computer program and how it is written using a programming language. - The characteristics of an algorithm and examples of algorithms and corresponding flowcharts. - The different generations of programming languages from machine language to high-level languages to problem-oriented languages.

Uploaded by

Joshua Fleming
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

A computer program is a collection of instructions that performs a specific task when executed

by a computer. A computer program is usually written by a computer programmer in a


programming language. A programming language is used by programmers to develop software
programs, scripts, or other sets of instructions for computers to execute.

ALGORITHM:-
An algorithm is a well-defined procedure consisting of a finite set of unambiguous(expressed in a way
that makes it completely clear what is meant: ) instructions which specify a finite sequence of operations
that provides the solution to a problem, or to a specific class of problems for any allowable set of input
quantities (if there are inputs). In other word, an algorithm is a step-by-step procedure to solve a given
problem
Characteristics of an Algorithm
Not all procedures can be called an algorithm. An algorithm should have the below mentioned
characteristics −
 Unambiguous − Algorithm should be clear and unambiguous. Each of its steps (or
phases), and their input/outputs should be clear and must lead to only one meaning.
 Input − An algorithm should have 0 or more well defined inputs.
 Output − An algorithm should have 1 or more well defined outputs, and should match the
desired output.
 Finiteness − Algorithms must terminate after a finite number of steps.
 Feasibility − Should be feasible with the available resources.
 Independent − An algorithm should have step-by-step directions which should be
independent of any programming code
Flow chart:-
A flowchart is a graphical representation of an algorithm or a stepwise process, showing the steps
as boxes of various kinds, and their order by connecting these with arrows. Flowcharts are used in
designing or documenting a process or program . Flow charts are easy-to-understand diagrams
showing how processes work, and for clearly documenting how a particular job is done.
Flowcharting Symbols
Generally, there are many standard flowcharting symbols. The 6 basic symbols commonly used
in flowcharting a programs: are Terminal, Process, input/output, Decision, Connector and
Predefined Process

Symbol Name Function

Process Indicates any type of internal operation

inside the Processor or Memory

input/output Used for any Input / Output (I/O) operation.

Indicates that the computer is to obtain data

or output results
1
Used to ask a question that can be answered in a binary format
Decision (Yes/No or True/False)

Connector Allows the flowchart to be drawn without

intersecting lines or without a reverse flow.

Predefined Process Used to invoke a subroutine or an

interrupt program.

Terminal Indicates the starting or ending of the

program, process, or interrupt program.

Flow Lines Shows direction of flow.

ADVANTAGES OF USING FLOWCHARTS


The benefits of flowcharts are as follows:
1. Communication: Flowcharts are better way of communicating the logic of a system to
all concerned.
2. Effective analysis: With the help of flowchart, problem can be analyzed in more effective way.
3. Proper documentation: Program flowcharts serve as a good program documentation, which is needed
for various purposes.
4. Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program
development phase.
5. Proper Debugging: The flowchart helps in debugging process.
6. Efficient Program Maintenance: The maintenance of operating program becomes easy with the help
of flowchart. It helps the programmer to put efforts more efficiently on that part
Defining Pseudocode
Pseudocode is a standard way of describing an algorithm without use of any specific programming
language syntax. It is a simple way of writing programming code in English. Pseudocode is not actual
programming language but It uses short phrases to write code for programs before actually creating it in
a specific language. Once we know what the program is about and how it will function, then we can use
pseudocode to create statements to achieve the required results for your program .
Examples of Pseudocode
Examples of Algorithms and Flowcharts
Example 1. Design an algorithm, pseudocode and the corresponding flowchart for adding the test scores
as given below: 26, 49, 98, 87, 62, 75

2
Algorithm 13. Get the sixth testscore
1. Start 14. Add to sum
2. Sum = 0 15. Output the sum
3. Get the first testscore 16. Stop
4. Add first testscore to sum pseudocode:
5. Get the second testscore 1. Start
6. Add to sum 2. Sum = 0
7. Get the third testscore 3. Get a value
8. Add to sum 4. sum = sum + value
9. Get the Forth testscore 5. Go to step 3 to get next Value
10. Add to sum 6. Output the sum
11. Get the fifth testscore 7. Stop
12. Add to sum
A programming language is a formal language that specifies a set of instructions that can be used to
produce various kinds of output. Programming languages generally consist of instructions for
a computer. Programming languages can be used to create programs that implement
specific algorithms.
Generations of Programming Languages
A programming language is a set of rules that tells the computer what operations to do. These
languages are used by the programmers to create other kinds of software. there are five levels,
Generations, of programming languages, ranging from low-level to high-level. The five generation of
programming languages are.
First Generation: Machine Language
Machine language is the basic language of the computer, representing data as 1s and Os. Each CPU
model has its own machine language: Machine language programs vary from computer to computer,
i.e., they are machine-dependent. . These binary digits, which correspond to the on and off electrical
states of the computer, are clearly not convenient for people to read and use.
Advantages:- Very efficient Require less storage space
Disadvantages:- Machine dependent Programming is difficult
Second Generation: Assembly Language
assembly language is a low-level programming language that allows a computer user to write a
program using abbreviations or more easily remembered words instead of numbers, A programmer
can write instructions in assembly language more quickly than in machine language, In these
languages, each numeric instruction is assigned a short name (called a mnemonic) that is easier to
remember than a number.
Advantages:- It is easier to modify than machine language Easier to understand and use
Disadvantages:-
 The coding to assembly language is time consuming They are also machine dependent
An assembler, or assembler program, is a program that translates the assembly-language program
into machine language.
Third Generation: High-Level or Procedural Languages
A high level or procedural language resembles some human language such as English. For example,
COBOL, which is used for business applications. A procedural language allow users to write in a

3
familiar notation, rather than numbers or abbreviations, Also, unlike machine and assembly
languages, most of procedural languages are not machine dependent-i.e., they can be used on
more than one kind of computer. Few examples are FORTRAN, COBOL, BASIC, Pascal, c, c++, java
etc For a procedural language we need language translator to translate it into machine language.
Depending on the procedural language we may use either of the following types of translators: -
a compiler or an interpreter.
Advantages:- These are easy to learn. Easier to maintain.
They are not machine dependent. Programs are portable.
Fourth Generation: Problem Oriented Languages
Third-generation languages tell the computer how to do something. Fourth generation languages, in
contrast, tell the computer what to do. Very high-level or problem-oriented languages, also called
fourth-generation languages (4 GLs), are much more user-oriented and allow users to develop
programs with fewer commands compared with procedural languages, although they require more
computing power. These languages are known as problem-oriented because they are designed to
solve specific problems, whereas procedural languages are more general-purpose languages.
examples include Perl, PHP, Python, Ruby, and SQL.
basic types of language tools fall into the fourth generation language category.
1. Query languages 2.Report generators 3. Applications generators.
2. Decision support systems and financial planning languages.
Query languages
Query languages allow the user to ask questions about, or retrieve information from database files by
forming requests in normal human language statements (such as English). The difference between the
definitions for query language and for database management systems software is so slight that most
people consider the definitions to be the same. Query languages do have a specific grammar
vocabulary, and syntax that must be mastered, but this is usually a simple task for both users and
programmers.
Report generators
Report generators are similar to query languages in that they allow users to ask questions from a
database and retrieve information from it for a report (the output); however, in case of a report
generator, the user is unable to alter the contents of the database file. And with a report generator,
the user has much greater control over what the output will look like. The user of a report generator
can specify that the software automatically determine how the output should look or can create his or
her own customized output reports using special report generator command instructions .
Application generators
Application generators allow the user to reduce the time it takes to design an entire software
application that accepts input, ensures data has been input accurately, performs complex calculations
and processing logic, and outputs information in the form of reports. The user must key into
computer-useable form the specification for what the program is supposed to do. The resulting file is
input to the applications generator, which determine how to perform the tasks and which then
produces the necessary instructions for the software program.
Decision support systems and financial planning languages combine special interactive computer
programs and some special hardware to allow high level managers to bring data and information
together from different sources and manipulate it in new ways.
Fifth Generation: Natural Languages
4
Fifth-generation language is programming that uses a visual or graphical development interface to
create source language that is usually compiled with a 3GL or 4GL language compiler. Microsoft,
Borland, IBM, and other companies make 5GL visual programming products for developing
applications in Java, for example. Visual programming allows you to easily envision object-oriented
programming class hierarchies and drag icons to assemble program components. Examples of fifth
generation languages include Mercury, OPS5, and Prolog.
INTRODUCTION TO THE DESIGN AND IMPLEMENTATION OF CORRECT, EFFICIENT
AND MAINTAINABLE PROGRAMS
The design and development of a correct, efficient, and maintainable program depends on the
approach followed by the programmer. A programmer should follow standard methodologies
throughout the life cycle of program development. The entire program development process is
divided into a number of phases, with each phase serving a definite purpose. Also, the output
of one phase acts as an input for the next phase.
Analysis phase:
in this phase , the user’s expectations are gathered to understand why the program or software has to
be developed. Then , all the gathered requirements are analysed and the scope or objective of the
over all software product is penned down. The last activity in this phase involves documenting every
identified requirement of the user in order to avoid any doubts or uncertainty regarding the
functionality of the program. The functionality, capability, performance, and availability of hardware
and software components are all analysed in this phase
Designing phase:
In this phase, a plan of actions is made before the actual development process starts. This plan will be
followed throughout the development process. Moreover, in the design phase, the core structure of
the software or program is broken down in to modules. The solution of the program is then specified
for each module in the form of algorithms or flow charts . The design phase, therefore specifies how
the program or software will be developed..
Development phase:
In this phase, the designed algorithms are converted in to program code using any of the high level
languages. The particular choice of language will depend on the type of program such as whether it is a
system or an application program. For example C is preferred for writing system programs, whereas
Visual basic might be preferred for an application program. The program codes are tested by the
programmer to ensure their correctness..
Implementation and Testing:
In this phase , all the modules are tested together to ensure that the overall system works well as a
whole product. In this phase, the software is tested using a large number of varied inputs, also known
as test data, to ensure that the software is working as expected by the user’s requirements identified
in the requirements analysis phase

Maintenance:
Maintenance and enhancements are ongoing activities that are done to cope with newly discovered
problems or new requirements. Such activities may take a long time to complete .

You might also like