0% found this document useful (0 votes)
26 views14 pages

Introduction to Programming Languages

Uploaded by

rohitk93639
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
26 views14 pages

Introduction to Programming Languages

Uploaded by

rohitk93639
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 14

Introduction to Programming Languages.

Programming Languages:-

A programming language defines a set of instructions that are compiled together


to perform a specific task by the CPU (Central Processing Unit).
The programming language mainly refers to high-level languages such as C,
C++, Pascal, Ada, COBOL, etc.

A programming language is a formal language comprising a set


of instructions that produce various kinds of output. Programming languages are
used in computer programming to implement algorithms. Most programming
languages consist of instructions for computers.

Following are the major categories of Programming Languages:-

 Machine Language.
 Assembly Language.
 High Level Language.
 System Language.
 Scripting Language.

Machine Language or Code

This is the language that is written for the computer hardware. Such language is
affected directly by the central processing unit (CPU) of a computer system.

Assembly Language

It is a language of an encoding of machine code that makes simpler and readable.

High Level Language

The high level language is simple and easy to understand and it is similar to
English language. For example, COBOL, FORTRAN, BASIC, C, C+, Python,
etc.
High-level languages are very important, as they help in developing complex
software and they have the following advantages:-
 Unlike assembly language or machine language, users do not need to learn
the high-level language in order to work with it.
 High-level languages are similar to natural languages, therefore, easy to
learn and understand.
 High-level language is designed in such a way that it detects the errors
immediately.
 High-level language is easy to maintain and it can be easily modified.
 High-level language makes development faster.
 High-level language is comparatively cheaper to develop.
 High-level language is easier to document.

System Language

A system programming language is a programming language used


for system programming; such languages are designed for
writing system software, which usually requires different development approaches
when compared with application software. Examples of such languages include
ALGOL and Pascal.
Scripting language
A scripting language is a programming language that is interpreted. It is translated
into machine code when the code is run, rather than beforehand. Scripting
languages are often used for short scripts over full computer
programs. JavaScript, Python, and Ruby are all examples of scripting languages.
DATA:-

Data can be described as unprocessed facts and figures. Plain collected data as
raw facts cannot help in decision-making. However, data is the raw material that
is organized, structured, and interpreted to create useful information systems.
Data is defined as 'groups of non-random symbols in the form of text, images, and
voice representing quantities, action and objects'.
OR,

Data can be defined as a representation of facts, concepts, or instructions in a


formalized manner, which should be suitable for communication, interpretation,
or processing, by human or electronic machine.
Data is represented with the help of characters such as alphabets (A-Z, a-z), digits
(0-9) or special characters (+,-, /,*, <,>, = etc.)

Information
Information is a data that has been processed into a form that is meaningful to
recipient and is of real or perceived value in the current or the prospective action or
decision of recipient.

Knowledge

Knowledge is more complicated than data or information, because it is subjective,


often based on experience, and highly provisional.

Characteristics of Information:-
Good information is relevant for its purpose, sufficiently accurate for its purpose,
completes enough for the problem, reliable and targeted to the right person. It is
also communicated in time for its purpose, contains the right level of detail and is
communicated by an appropriate channel, i.e. one that is understandable to the
user.

Availability/accessibility

Information should be easy to obtain or access. Information kept in a book of


some kind is only available and easy to access if you have the book to hand. A
good example of availability is a telephone directory, as every home has one for its
local area. It is probably the first place you look for a local number. But nobody
keeps the whole country’s telephone books so for numbers further afield you
probably phone a directory enquiry number. For business premises, say for a hotel
in London, you would probably use the Internet.
Accuracy

Information needs to be accurate enough for the use to which it is going to be put.
To obtain information that is 100% accurate is usually unrealistic as it is likely to
be too expensive to produce on time Accuracy is important. As an example, if
government statistics based on the last census wrongly show an increase in births
within an area, plans may be made to build schools and construction companies
may invest in new housing developments. In these cases any investment may not
be recouped.

Reliability or objectivity

Reliability deals with the truth of information or the objectivity with which it is
presented. You can only really use information confidently if you are sure of its
reliability and objectivity.
Relevance/appropriateness

Information should be relevant to the purpose for which it is required. It must be


suitable. What is relevant for one manager may not be relevant for another. The
user will become frustrated if information contains data irrelevant to the task in
hand.

For example, a market research company may give information on users’


perceptions of the quality of a product. This is not relevant for the manager who
wants to know opinions on relative prices of the product and its rivals. The
information gained would not be relevant to the purpose.

Completeness

Information should contain all the details required by the user. Otherwise, it may
not be useful as the basis for making a decision. For example, if an organization is
supplied with information regarding the costs of supplying a fleet of cars for the
sales force, and servicing and maintenance costs are not included, then a costing
based on the information supplied will be considerably underestimated.

Level of detail/conciseness

Information should be in a form that is short enough to allow for its examination
and use. There should be no extraneous information. For example, it is very
common practice to summaries financial data and presents this information, both in
the form of figures and by using a chart or graph. We would say that the graph is
more concise than the tables of figures as there is little or no extraneous
information in the graph or chart. Clearly there is a trade-off between level of
detail and conciseness.

Presentation

The presentation of information is important to the user. Information can be more


easily assimilated if it is aesthetically pleasing. For example, a marketing report
that includes graphs of statistics will be more concise as well as more aesthetically
pleasing to the users within the organization. Many organizations use presentation
software and show summary information via a data projector. These presentations
have usually been well thought out to be visually attractive and to convey the
correct amount of detail.

Timing

Information must be on time for the purpose for which it is required. Information
received too late will be irrelevant. For example, if you receive a brochure from a
theatre and notice there was a concert by your favorite band yesterday, then the
information is too late to be of use.

Comparison between human language & Computer Language:-


Natural language such as English is the language, which is spoken and written for
communication. The natural language consists of syntax, semantics, phonetics, etc.
All natural languages have some fundamental rules, which are based on the
structure of grammar. These grammatical rules are used by people in
communication.

Programming languages are used for developing


computer programs, which enable a computer to perform some operations. The
structure of these languages is based on some syntactic and semantic rules.
Context-free, lexical and syntactic grammar may be used in Java programming.

The differences in the grammar of high level programming languages (e.g.


Java) and natural language (e.g. English) are as follows:-

 Natural languages are used for communication between people and


programming languages enable human to interact with machines.
 Programming languages need a high degree of expertise, completeness and
precision because computer cannot think outside the statement while in
speaking, some minor errors are ignored.
 The programming language syntax is not based on natural language
grammar.

What is a program?
A program is a collection of data and instructions that can
be executed by a computer to perform a specific task. A computer
program is usually written by a computer programmer in a programming
language.
Introduction to Computer Programming & Concept.
If you understood what a computer program is, then we will say: the act of
writing computer programs is called computer programming.

As we mentioned earlier, there are hundreds of programming languages, which


can be used to write computer programs and following are a few of them :-

 Java.

 C.

 C++.

 Python.

 PHP.

 Perl.

 Ruby.

Uses of Computer Programs:-


Today computer programs are being used in almost every field,
household, agriculture, medical, entertainment, defense, communication,
etc. Listed below are a few applications of computer programs:-
 MS Word, MS Excel, Adobe Photoshop, Internet Explorer,
Chrome, etc., are examples of computer programs.
 Computer programs are being used to develop graphics and special
effects in movie making.
 Computer programs are being used to perform Ultrasounds, X-
Rays, and other medical examinations.
 Computer programs are being used in our mobile phones for SMS,
Chat, and voice communication.

Programming development cycle:-

The various stages in the development of a computer


program are:-
Problem Definition.
Program Design.
Coding.
Debugging.
Testing.
Documentation.
Maintenance.
Problem Definition:-
 The first step in the process of program development is the
thorough understanding and identification of the problem for
which is the program or software is to be developed.
 In this step the problem has to be defined formally.
 All the factors like Input/output, processing requirement, memory
requirements, error handling, interfacing with other programs have
to be taken into consideration in this stage.

Program Design: -
 The next stage is the program design. The software developer
makes use of tools like algorithms and flowcharts to develop the
design of the program.
 Algorithm.
 Flowchart.

Coding:-
 Once the design process is complete, the actual computer program
is written, i.e. the instructions are written in a computer language.
 Coding is generally a very small part of the entire program
development process and also a less time consuming activity in
reality.
 In this process all the syntax errors i.e. errors related to spelling,
missing commas, undefined labels etc. are eliminated.
 For effective coding some of the guide lines which are applied are :
 Use of meaningful names and labels of variables,
 Simple and clear expressions,
 Modularity with emphasis on making modules generalized,
 Making use of comments and indenting the code properly,
 Avoiding jumps in the program to transfer control.
Debugging:-
 At this stage the errors in the programs are detected and
corrected.
 This stage of program development is an important process.
Debugging is also known as program validation.
 Some common errors which might occur in the programs
include:
 UN initialization of variables.
 Reversing of order of operands.
 Confusion of numbers and characters.
 Inverting of conditions. Eg: - Jumping on zero instead of on not
zero.

Testing:-
 The program is tested on a number of suitable test cases.
 A test plan of the program has to be done at the stage of the
program design itself.
 This ensures a thorough understanding of the specifications.
 The most trivial and the most special cases should be
identified and tested.
 It is always useful to include the maximum and minimum
values of all variables as test data.

Documentation:-
 Documentation is a very essential step in the program
development.
 Documentation helps the users and the people who maintain
the software.
 This ensures that future modification if required can be done
easily. Also it is required during redesigning and
maintenance.
Maintenance:-
 Updating and correction of the program for changed
conditions and field experience is accounted for in
maintenance.
 Maintenance becomes essential in following situations:
 Change in specification,
 Change in equipment,
 Errors which are found during the actual execution of the program
What is Algorithm?
The word Algorithm means “a process or set of rules to be
followed in calculations or other problem-solving operations”.
Therefore Algorithm refers to a set of rules/instructions that step-
by-step define how a work is to be executed upon in order to get
the expected results.
It can be understood by taking an example of cooking a new recipe. To
cook a new recipe, one reads the instructions and steps and executes
them one by one, in the given sequence. The result thus obtained is the
new dish cooked perfectly. Similarly, algorithms help to do a task in
programming to get the expected Output. The Algorithm designed is
language-independent, i.e. they are just plain instructions that can be
implemented in any language, and yet the output will be the same, as
expected.
What are the Characteristics of an Algorithm?

As one would not follow any written instructions to cook the recipe, but
only the standard one. Similarly, not all written instructions for
programming are an algorithm. In order for some instructions to be an
algorithm, it must have the following characteristics:-
 Clear and Unambiguous:- Algorithm should be clear and
unambiguous. Each of its steps should be clear in all aspects and
must lead to only one meaning.
 Well-Defined Inputs:- If an algorithm says to take inputs, it
should be well-defined inputs.
 Well-Defined Outputs:- The algorithm must clearly define what
output will be yielded and it should be well-defined as well.
 Finite-ness:- The algorithm must be finite, i.e. it should not end up
in an infinite loops or similar.
 Feasible:- The algorithm must be simple, generic and practical;
such that it can be executed upon will the available resources. It
must not contain some future technology, or anything.
 Language Independent:- The Algorithm designed must be
language-independent, i.e. it must be just plain instructions that can
be implemented in any language, and yet the output will be same,
as expected.

How to Design an Algorithm?


In order to write an algorithm, following things are needed as a pre-
requisite:-
 The problem that is to be solved by this algorithm.
 The constraints of the problem that must be considered while
solving the problem.
 The input to be taken to solve the problem.
 The output to be expected when the problem the is solved.
 The solution to this problem, in the given constraints.
Then the algorithm is written with the help of above parameters such
that it solves the problem.
Program Flowcharts:-
It is a technique developed by Larry Constantine to express the requirements of
system in a graphical form.

 It shows the flow of data between various functions of system and specifies
how the current system is implemented.

 It is an initial stage of design phase that functionally divides the requirement


specifications down to the lowest level of detail.
 Its graphical nature makes it a good communication tool between user and
analyst or analyst and system designer.

 It gives an overview of what data a system processes, what transformations


are performed, what data are stored, what results are produced and where
they flow.

Basic Elements of DFD:-


DFD is easy to understand and quite effective when the required design is not clear
and the user want a notational language for communication. However, it requires a
large number of iterations for obtaining the most accurate and complete solution.

The following table shows the symbols used in designing a


DFD and their significance:-

Symbol Name Symbol Meaning

Square Source or
Destination of
Data.

Arrow Data flow.

Circle Process
transforming data
flow.

Open Rectangle Data Store.


Pseudo code:-
A pseudo code does not conform to any programming language and expresses
logic in plain English.

 It may specify the physical programming logic without actual coding during
and after the physical design.

 It is used in conjunction with structured programming.

 It replaces the flowcharts of a program.

You might also like