Professional Documents
Culture Documents
Fundamental and
Programming
Prepared by: Mary Kris P. Morco
Professorial Lecturer
Today's Agenda
Programming Languages
Number System
Introduction to Programming Languages
Programming Languages
Programming languages are the basic building blocks for all software, allowing people to
tell computers what to do and the means by which software are developed. A
programming language or computer language is a standardized communication
technique for expressing instructions to a computer. To communicate with computer, we
need to use language which computer can understand and process i.e. programs should
be written in computer understandable languages called programming languages.
Programming language consists of a set of characters, symbols and set of rules known as
syntax rule. Programmer has to follow all specified rules strictly to get desired results. In
general, programming language is a set of syntactic and semantic rules used to define
computer programs.
What is a
Programming
Languages?
A programming language is a formal
language comprising a set of strings that
produce various kinds of machine code
output. Programming languages are one
kind of computer language, and are used
in computer programming to implement
algorithms.
What is a Programming Language (contd...)
A programming language is a special language programmers use to
develop software programs, scripts, or other sets of instruction for
computers to execute.
11. SQL (Structured Query Language) - is a database query
language (not a development language) that allows for adding,
accessing and managing content in a database. It is the language
that allows programmers to perform the common acronym CRUD
(Create; Read; Update; Delete) within a database.
12. Swift - is Apple’s newest open-source, multi-paradigm
programming language for iOS and OS X apps. Swift integrates
Objective-C’s named parameters and object-oriented model, while
including an advanced compiler, debugger and framework
infrastructure.
Why do we Why are there
need a so many
Programming Programming
Language? Languages?
One language cannot serve all
These languages allow computers to
application areas well.
quickly and efficiently process large and
complex ranges of information. Different nations people speak
We need them because COMPUTERS different languages, in the same way
CAN'T UNDERSTAND ENGLISH AND for different purposes we need
HUMANS CAN'T EASILY WRITE different languages.
MACHINE CODE. Programming languages have evolved
Like many human-based languages, over time as different ways have been
there is a range of computer developed to design them.
programming languages that
programmers can use to communicate
with a computer.
Programming
languages are
generally classified in
two categories;
1. Low Level Language
2. High Level Language.
Low Level High Level
Language Language
A low level language is a High Level Language is much closer
programming language that is much to human language so it is more
closer to the hardware. It requires a suitable to write code in high level
thorough knowledge of the hardware language. It is more or less
for which the program is being independent of the particular type of
created. It can be divided into two computer used. And, High level
types, Machine Language and language are classified in two broad
Assembly Language. categories; they are procedure
oriented programming language and
object oriented programming
language.
Programming Language Classification
Machine Language (Low Level Language)
Computer understands only machine language that uses 0s and 1s.
It is the lowest level language that computer understands. In
machine language different instructions are formed by taking
combinations of 0s and 1s. The computer converts all high level
languages into machine language before executing any statements.
Machine language is written in binary form that a computer can
execute directly. These are also known as machine code or object
code. This language is not feasible for humans to use because it
consists entirely of binary numbers. This language is fastest in
terms of execution in the sense that it does not need to be
translated.
Advantage of Machine Disadvantage of Machine
Language Language
Machine Dependent : Program written in
Translation Free : Machine language is the
machine language are machine dependent
only language that computer understands.
and hence program developed for one
Program written in languages other than
system does not execute on other system.
machine language must be translated to
Complex Language for Programming : Since
machine language. However, the program
machine language consists only sequence of
written in machine language can be directly
0s and 1s, so it is very difficult for
executed without any translation.
programmer to remember and write each
High Speed : Since program written in
instructions.
machine language need not to be translated
Error Prone : While programming using
and hence conversion time is saved which
machine language everything need to be
enables execution of machine language
expressed in sequence of 0s and 1s which is
program extremely fast.
very tedious task. So errors are frequently
occurred while programming using machine
language.
Time Consuming : Writing program in
machine language is time consuming
process.
Assembly Language (Low Level Language)
Instruction formed by using 1s and 0s i.e. using binary numbers
are hard to remember and it is tedious to program using it. In
assembly language the binary bits are replaced by certain
keywords which are known as mnemonic. These mnemonics are in
fact abbreviated letters which are much easier to remember. This
language is easier to learn than machine language. An assembler is
used to convert assembly language into machine language. It is still
faster as compared to high level language but slower than lowest
level language (Machine language) due to the requirement of
translation.
Working of an Assembler
Advantage of Assembly Disadvantage of Assembly
Language Language
Machine Dependent:Program written in
Easy to Understand and Use: Assembly
assembly language are machine dependent
language uses mnemonic codes which are
and hence program developed for one
easy to use and remember. So, errors which
system does not execute on other system.
can occur while writing program using
Difficult to Learn :Since assembly language
assembly language are less as compared to
is machine dependent so every type of
writing program using machine language.
computer architecture requires a different
Also, assembler provides a way to locate
assembly language. Programmer need to
and correct errors.
study and understand different mnemonic
Speed: Program written in assembly
code according to the architecture used.
language executes faster than program
Slow Program Development Time:
written high level language.
Developing program in assembly language is
slow process as compared to high level
language.
High Level Language (Advantages,
Disadvantages & Types)
High level language is much closer to human language so it is more
suitable to write code in high level language. It is more or less
independent of the particular type of computer used (i.e. more
portable) and has its own set of rules called syntax. Its main
advantage is that it is easier to read, write and maintain. The first
high level programming languages were designed in the 1950s.
Now there are dozens of such languages available such as BASIC,
COBOL, C, C++, FORTRAN, LISP, PASCAL, prolog, etc. This
language is lot slower in terms of execution as compared to low
level language. Compiler or interpreter is used to convert high
level language to machine language.
Working of Compiler or Interpreter
Advantage of High Level Disadvantage of High
Language Level Language
Easy to Use and Understand : High level language Poor Control on Hardware: Since high level
uses English like words and they are closer to languages are away from hardware and
natural language which makes easy to learn and programmer does not need to be aware of
understand. Programmer need not to understand
hardware, accessing and controlling
detailed computer architecture for writing
hardware directly is difficult.
programs using high level language.
Machine Independent : Programs written in high Slow Execution: Program written in high
level language are portable and hence program level language need to be translated to
written using high level language can be machine language. This translation process
executed on any type of computer with little or increases the execution time of program.
no modification at all.
Debugging is Easy : High level language makes
easier to write and debug a program and gives
the programmer time to think about overall logic
rather than thinking about program code.
Because of the use of compilers and interpreters,
errors can be detected and located easily.
Easy to Maintain Program : Modification and
maintenance of program written in high level
language is easy compared low level language.
A high level language
can be further
categorized into:
1. Object oriented
2. Procedural programming
language.
Procedure Oriented Object Oriented
Programming Language Programming Language
Procedural programming is based upon the In object oriented programming; the data
idea of series of procedure calls. A (i.e. variables) and code are combined to
programmer writing program in this form objects. This allows more effective
language can exactly specify a sequence of code duplication which is not the case when
steps in order to perform a particular task. programs are divided into subroutines (or
Languages which express step-by-step functions). The required programming parts
algorithms written to solve a problem are can be called again and again within the
known as procedural languages. A program. Its main distinction with
procedure may be a program in itself that procedural programming is that in
may be called within a main program, a procedural programming task is divided
subroutine or another program. A into subroutines, structures and functions.
programmer knows exactly what is to be Whereas in object oriented programming,
accomplished at the end of the program and data as well as functions and subroutines
uses a sequence of algorithmic steps in are encapsulated to form objects. C++
order to achieve it. C language is example of language is example of object oriented
procedure oriented programming language. programming language.
Low level programming languages are machine dependent that
means program written in low level language are not portable.
Language Low level language programs are faster because they do not
(Differences) require much translation.
(Differences)
(contd...) Low level language provide no or less abstraction from hardware.
Languages [3GL] A language translator is required to convert a high-level language program into
machine language. Two types of language translators are used with high level
As a refined version of second generation languages: compilers and interpreters.
programming language, the third generation
programming language emerged which brought a
structured logic to the software, making One line of Third Generation Code can produce many lines of object code ,
programming more user friendly. The high level saving lots of time and is easier while writing programs.
languages of this generation are more English-like in
structure where each and every statement is taken
from natural language. The codes written in this 3GL are easy to write and maintain.
language need to be translated, which is done by a
compiler or interpreter. Due to this translation
process the codes run much slower. The codes are Examples :C,C++,Java , COBOL,BASIC(Beginners All Purpose Symbolic
easier to edit and debug and are machine
independent. A programmer does not require the
Instruction Code),FORTRAN(Formula Translation),ALGOL(Algorithmic
hardware and details of the machine being Language), APL(A Programming Language)
programmed. Examples of 3GL are C, C++, C#,
PASCAL, FORTRAN, JAVA, etc.
Advantages: Hardware Independence , time saving ,programmer friendly
Disadvantages: Code used might not make best use ofprocessor specific
features unlike 1GL ,2GL.
Also known as Very High Level Language.
Fourth Generation They allow programmers and users to specify what thecomputer
Languages [4GL] is supposed to do without having to specify howthe computer is
supposed to do it.
The fourth generation programming language is one step
ahead of the third generation programming language. So much easier than other generations.
There are fewer options for the programmers, but the
programs are much easier to write and debug than 3GLs.
There built in GUI (Graphical user interfaces) objects like
buttons, dropdown menus, add-ins, etc. and no separate
Used with Databases.
code needs to be written for them. These languages are
particularly developed with the viewpoint of solving a
particular class of problem. Given the right kind of
problem, the use of an appropriate 4GL can be Five basic types of language tools fall into the fourthgeneration
spectacularly successful. All 4GLs are designed to reduce language category.
programming effort, the time it takes to develop software,
and the cost of software development. Compilers and (1)Query languages
interpreters are still needed to convert it into machine
code. Thus a single line code in this language is equivalent (2)Report generators
to more lines of coding in lower level language. Therefore, (3)Applications generators.
the programs generated using these languages are larger
and much slower. For e.g. SQL, ORACLE, MATLAB, (4)Decision support systems and financial planning languages.
ColdFusion, CSS etc. (5)Some microcomputer application software
Fifth Generation Languages used for artificial intelligence and neural networks.
JavaScript , VBScript , bash, sh, ch. TeX, PostScript, SGML. HTML, XML
PHP, Perl, Python ,Ruby ,
JSP.
Problem Solving
Using Computer
Computer based problem solving is a systematic
process of designing, implementing and using
programming tools during the problem solving
stage. This method enables the computer system to
be more intuitive with human logic than machine
logic. Final outcome of this process is software tools
Problem Solving which is dedicated to solve the problem under
consideration. Software is just a collection of
Using Computer computer programs and programs are a set of
instructions which guides computer’s hardware.
(Steps) These instructions need to be well specified for
solving the problem. After its creation, the software
should be error free and well documented. Software
development is the process of creating such
software, which satisfies end user’s requirements
and needs.
1. Problem Analysis
computer.
5. Debugging and Testing
6. Program Documentation
1.Problem Analysis
Problem analysis is the process of defining a problem and decomposing
overall system into smaller parts to identify possible inputs, processes
and outputs associated with the problem.
Guidelines for
Preparing Flowchart
Example of Flowchart
Advantages of Disadvantages of
Flowchart Flowchart
Effective Communication : Flowcharts Complex Logic: For complicated logic,
are better way of communicating the logic flowchart becomes complex and clumsy.
of the system. Difficulty in Modifications: If change is
Effective Analysis : Using flowchart required in the logic then flowchart needs
problem can be analyzed more efficiently. to be redrawn and requires a lot of time.
Easy Debugging and Efficient Testing :
The Flowchart helps in debugging and
testing process.
Efficient Coding : The flowcharts are very
useful during program development
phase.
Proper Documentation : Flowcharts
serves as a good program documentation,
which is needed for various purpose.
Efficient Program Maintenance :
Maintenance of operating programs
becomes easy with the help of flowchart.
Pseudocodes (Guidelines, Advantages &
Disadvantages)
Pseudocode is structured English for describing algorithms
concisely. It is made up of two words, namely, pseudo meaning
imitation and code meaning instructions. As the name suggests,
pseudocode does not obey the syntax rules of any particular
programming language i.e. it is not a real programming code. It
allows the designer to focus on main logic without being distracted
by programming languages syntax.
Following points should be remembered while preparing
pseudocode :
Guidelines for 1. Pseudocode will be enclosed by START (or BEGIN) and STOP
(or END).
Preparing 2. Pseudocode should be concise so ignore unnecessary details.
3. To accept data from user, generally used statements are INPUT,
Pseudocode READ, GET or OBTAIN.
4. To display result or any message, generally used statements are
PRINT, DISPLAY, or WRITE.
5. Generally used keywords are capitalized while preparing
pseudocode.
Example of Pseudocode
Advantages of Disdvantages of
Pseudocode Pseudocode
It allows the designer to focus on There are no accepted standards
main logic without being for writing pseudocodes and
distracted by programming designer use their own style while
languages syntax. writing pseudocodes.
Since it is language independent, Pseudocode cannot be compiled
it can be translated to any and executed so its correctness
computer language code. cannot be verified by using
It allows designer to express logic computers.
in plain natural language.
It is easier to write actual code
using pseudocode.
Unlike algorithms, pseudocodes
are concise so pseudocodes are
more readable and easier to
modify.
3.Coding (Programming)
In this stage, process of writing actual program takes place. A coded program is
most popularly referred to as a source code. The coding process can be done in
any language (high level and low level). The actual use of computer takes place in
this stage in which the programmer writes a sequence of instructions ready for
execution. Coding is also known as programming.
Comment clauses in the program help to make the program
readable and understandable by people other than the original
Good program programmer.
It should be efficient.
possess following It must be reliable enough to work under all reasonable
conditions to provide a correct output.
characteristics : It must be able to detect unreasonable error conditions and
report them to the end user or programmer without crashing
the system.
It should be easy to maintain and support after installation.
4.Compilation and
Execution Process
Generally coding is done in high level language or low level language (assembly
language). For the computer to understand these languages, they must be
translated into machine level language. The translation process is carried out by
a compiler/interpreter (for high level language) or an assembler (for assembly
language program). The machine language code thus created can be saved and
run immediately or later on.
Error
Debugging Testing
Testing is performed to verify
Debugging is the process of
that whether the completed
finding errors and removing
software package functions or
them from a computer program,
works according to the
otherwise they will lead to
expectations defined by the
failure of the program. Even
requirements. Testing is
after taking full care during
generally performed by testing
program design and coding,
team which repetitively
some errors may remain in the
executes program with intent to
program and these errors
find error. After testing, list of
appear during compilation or
errors and related information
linking or execution. Debugging
is sent to program developer or
is generally done by program
developmen team.
developer.
Major differences between debugging and testing are pointed below :
Debugging:
It is the process of fixing errors.
Debugging is done during program development phase.
Debugging vs Debugging is done by program developer.
Testing Testing:
It is the process of finding as many errors as possible
Testing is done during testing phase which comes after development
phase.
Testing is generally carried out by separate testing team rather than
program developer.
6. Program Documentation
The program documentation is the process of collecting information about the
program. The documentation process starts from the problem analysis phase to
debugging and testing. Documentation consists two types of documentation, they
are:
1. Programmer's Documentation
2. User's Documentation
Programmer's User's Documentation
Documentation
User documentation is required for the end
user who installs and uses the program. It
Programmer’s documentation contains all the
technical details. Without proper documentation consists instructions for installation of the
it is very difficult even for the original programmer program and user manual.
to update and maintain the program. A
programmer’s documentation contains the
necessary information that a programmer requires
to update and maintain the program.
These information includes:
1. Program analysis document, with a concise
statement of program’s objectives, outputs and
processing procedures.
2. Program design documents with appropriate
flowcharts and diagrams.
3. Program verification documents for outlining,
checking, testing and correction procedures along
with the list of sample data and results.
4. Log used to document future program revision
and maintenance activity.
Number System
What is number
system?
A number system is a system
representing numbers. It is also
called the system of
numeration and it defines a set
of values to represent a
quantity. These numbers are
used as digits and the most
common ones are 0 and 1, that
are used to represent binary
numbers.
Thank you
for
listening!