SlideShare a Scribd company logo
COMPUTER
PROGRAMMING
NMOHAMEDASARUDEEN
2018/PAS/ICT/M/001
PASDUNRATANATIONALCOLLEGEOFEDUCATION
Translators
New Edition
Compiler Object
Oriented
Programming
© Copyright 2020
INTRODUCTION
Mohamed Asarudeen
Computer programming is the act of writing computer programs,
which are a sequence of instructions written using a Computer
Programming Language to perform a specified task by the
computer.
Computer Programming is fun and easy to learn provided you
adopt a proper approach. This tutorial attempts to cover the
basics of computer programming using a simple and practical
approach for the benefit of novice learners.
This EBook has been prepared for the beginners who are willing
to learn computer programming but they are unable to learn it
due to lack of proper guidance.
Copyright & Disclaimer
@ Copyright 2020 by N Mohamed Asarudeen.
All the content and graphics published in this e-book are the
property of N Mohamed Asarudeen. . The user of this e-book is
prohibited to reuse, retain, copy, distribute or republish any
contents or a part of contents of this e-book in any manner
without written consent of the publisher.
Mohamed Asardeen
Asardeen68@gmail.com
TABLE OF
CONTENTSOVERVIEW 1…………………………………………..#
INTRODUCTION OF THE PROGRAM 1.1………………........#
INTRODUCTION TO COMPUTER PROGRAMMING…….……..#
USES OF COMPUTER PROGRAM 1.3………………….……#
COMPUTER PROGRAMMER 1.4………………….…..#
ALGORITHM 1.5…………………………………………..#
REPRESENTATION OF AN ALGORITHM................................#
LOW LEVEL PROGRAMMING LANGUAGE 2..….#
MACHINE LANGUAGE 2.1………………………………...#
ASSEMBLY LANGUAGE 2.2………………………………..#
HIGH LEVEL PROGRAMMING LANGUAGE 3..…#
PROGRAMMING LANGUAGE TYPES 4….……….#
SERVER SIDE PROGRAMMING 4.1…………...………….…#
CLIENT SIDE PROGRAMMING 4.2…………………………#
PROGRAMMING AND SCRIPTING……………….……..#
LANGUAGE TRANSLATORS 5……..……………..#
INTERPRETOR 5.1……………………………………...#
COMPILER 5.2……………………………………….…#
TEXT EDITOR 5.3………………………………………#
1.OVERVIEW
4
1.1 Introduction to Computer Program
Before getting into computer programming, let us first understand
computer programs and what they do.
A computer program is a sequence of instructions written using a
Computer Programming Language to perform a specified task by
the computer.
The two important terms that we have used in the above definition
are:
• Sequence of instructions
• Computer Programming Language
To understand these terms, consider a situation when someone asks
you about how to go to a nearby KFC. What exactly do you do to
tell him the way to go to KFC?
You will use Human Language to tell the way to go to KFC,
something as follows:
Here, you have used English Language to give several steps to be
taken to reach KFC. If they are followed in the following sequence,
then you will reach KFC:
1. Go straight
2. Drive half kilometer
3. Take left
4. Drive around one kilometer
5. Search for KFC at your right side
First go straight, after half kilometer, take left from the red light and then drive around one
kilometer and you will find KFC at the right.
5
Now, try to map the situation with a computer program. The above
sequence of instructions is actually a Human Program written in
English Language, which instructs on how to reach KFC from a
given starting point. This same sequence could have been given in
Spanish, Hindi, Arabic, or any other human language, provided the
person seeking direction knows any of these languages.
Now, let's go back and try to understand a computer program,
which is a sequence of instructions written in a Computer Language
to perform a specified task by the computer. Following is a simple
program written in Python programming Language:
The above computer program instructs the computer to print "Hello,
World!" on the computer screen.
• A computer program is also called a computer software, which can
range from two lines to millions of lines of instructions.
• Computer program instructions are also called program source code and
computer programming is also called program coding.
• A computer without a computer program is just a dump box; it is
programs that make computers active.
As we have developed so many languages to communicate among
ourselves, computer scientists have developed several computer-
programming languages to provide instructions to the computer
(i.e., to write computer programs). We will see several computer
programming languages in the subsequent chapters.
print "Hello, World!"
6
1.2 Introduction to Computer Programming
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
7
1.3 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.
1.4 Computer Programmer
Someone who can write computer programs or in other words,
someone who can do computer programming is called a Computer
Programmer.
Based on computer programming language expertise, we can name
a computer programmers as follows:
• C Programmer
• C++ Programmer
• Java Programmer
• Python Programmer
• PHP Programmer
8
1.5 Algorithm
An algorithm is a method to show the steps in solving a problem.
An algorithm is a step-by-step procedure for solving a problem. The
need for this is to present a way to solve the problem with a plan.
Example 1 - Let us develop an algorithm to post a letter.
1. Writing the letter
2. Folding the letter
3. Inserting the letter in an envelope
4. Writing the address
5. Sticking the stamp
6. Posting the letter
Thus, a computer programmer lists down all the steps required to
resolve a problem before writing the actual code. Following is a
simple example of an algorithm to find out the largest number from
a given list of numbers:
The above algorithm has been written in a crude way to help
beginners understand the concept. You will come across more
standardized ways of writing computer algorithms as you move on
to advanced levels of computer programming.
1. Get a list of numbers L1, L2, L3....LN
2. Assume L1 is the largest, Largest = L1
3. Take next number Li from the list and do the following
4. If Largest is less than Li
5. If Li is last number from the list then
6. Print value stored in Largest and come out
9
1.6 REPRESENTATION OFAN ALGORITHM
Flowchart
A flowchart is a type of diagram that represents
a workflow or process. A flowchart can also be defined as a
diagrammatic representation of an algorithm, a step-by-step
approach to solving a task.
The symbols given in table are used to indicate different functions.
10
E.g. 1 - Finding the area of a circle.
E.g. 2 - Finding whether a number is odd or even
2.LOWLEVELPROGRAMMING
LANGUAGE
11
2.1 Machine Language
Sometimes referred to as machine code or object code, machine
language is a collection of binary digits or bits that the computer
reads and interprets. Machine language is the only language a
computer is capable of understanding.
The exact machine language for a program or action can differ
by operating system. The specific operating system dictates how a
compiler writes a program or action into machine language.
Machine language example
Below is an example of machine language (binary) for the text
"Hello World."
Below is another example of machine language (non-binary), which
prints the letter "A" 1000 times to the computer screen.
01001000 01100101 01101100 01101100 01101111 00100000
01010111 01101111 01110010 01101100 01100100
169 1 160 0 153 0 128 153 0 129 153 130 153 0 131 200 208
241 96
12
2.2 Assembly language
Sometimes referred to as assembly or ASM, an assembly
language is a low-level programming language.
Programs written in assembly languages are compiled by
an assembler. Every assembler has its own assembly language,
which is designed for one specific computer architecture.
Machine language is a series of numbers, which is not easy for
humans to read. Using ASM, programmers can write human-
readable programs that correspond almost exactly to machine
language.
Assembly is called a low-level programming language because
there's (nearly) a one-to-one relationship between what it tells the
computer to do, and what the computer does. In general, one line of
an assembly program contains a maximum of one instruction for the
computer.
HIGHLEVELPROGRAMMING
LANGUAGE
13
A high-level language (HLL) is a programming language such
as C, FORTRAN, or Pascal that enables a programmer to
write programs that are more or less independent of a particular
type of computer. Such languages are considered high-level because
they are closer to human languages and further from machine
languages.
In contrast, assembly languages are considered low-level because
they are very close to machine languages.
Advantages of High-Level Languages
• The main advantage of high-level languages over low-level
languages is that they are easier to read, write, and maintain.
Ultimately, programs written in a high-level language must be
translated into machine language by a compiler or interpreter.
• The first high-level programming languages were designed in
the 1950s. Now there are dozens of different languages,
including Ada, Algol, BASIC, COBOL, C, C++,
FORTRAN, LISP, Pascal, and Prolog.
14
4.1 Server-side Programming
Server-side programming can be explained as:
It is the general name for the kind of program that runs directly
on the server.
Or we can say that server-side programming must deal with
dynamic content. It runs on the server. Most web pages are not
static since they deal with searching databases.
Server-side Uses
• It processes the user input
• Displays the requested pages
• Structure of web applications
• Interaction with servers/storages
• Interaction with databases
• Querying the database
• Encoding of data into HTML
• Operations over databases like delete, update.
• Server-side Languages Example
There are several languages that can be used for server-side
programming:
• PHP
• ASP.NET (C# OR Visual Basic)
• C++
• Java and JSP
• Python
• Ruby on Rails and so on.
PROGRAMMINGLANGUAGE
TYPES
4.2 Client-side Programming
Similarly to server-side programming, client-side programming is
also the name of the entire program that runs on the client.
Or we can say that client-side programming mostly deals with the
user interface with which the user interacts in the web. It is mostly a
browser, in the user's machine, that runs the code and is mainly
done in any scripting language like JavaScript (or we can use Flash
instead of JavaScript or VNScript).
Client-side Uses
• Makes interactive web pages
• Make stuff work dynamically
• Interact with temporary storage
• Sends requests to the server
• Retrieval of data from Server
• Interact with local storage
• Provides remote access for client-server program
• Client-side Languages Example
• Works as an interface between user and server
There are many client-side scripting languages too.
• JavaScript
• VBScript
• HTML (Structure)
• CSS (Designing)
• AJAX etc.
16
A translator is a programming language processor that
converts a computer program from one language to
another. It takes a program written in source code and
converts it into machine code. It discovers and identifies the
error during translation.
Purpose of Translator
It translates high-level language program into a machine
language program that the central processing unit (CPU) can
understand. It also detects errors in the program.
All of the above work in some way towards getting a high-
level programming language translated into machine code
that the central processing unit (CPU) can understand.
Examples of CPUs include those made by Intel (e.g., x86),
AMD (e.g., Athlon APU), NXP (e.g., PowerPC), and many
others. It’s important to note that all translators, compilers,
interpreters and assemblers are programs themselves.
5. LANGUAGETRANSLATORS
17
Assembler:
Assembler is the language translator designed to translate assembly
language program (source codes) into machine language program
(object codes). The original assembly language program codes are
called source codes and after translation, the nal machine language
program codes are called object codes.
Compiler
A compiler is a translator used to convert high-level programming
language to low-level programming language. It converts the
whole program in one session and reports errors detected after the
conversion. Compiler takes time to do its work as it translates high-
level code to lower-level code all at once and then saves it to
memory.
A compiler is processor-dependent and platform-dependent. But it
has been addressed by a special compiler, a cross-compiler and a
source-to-source compiler. Before choosing a compiler, user has to
identify first the Instruction Set Architecture (ISA), the operating
system (OS) and the programming language that will be used to
ensure that it will be compatible.
.
18
Compiler
Interpreter
Just like a compiler, is a translator used to convert
high-level programming language to low-level
programming language. It converts the program
one at a time and reports errors detected at once,
while doing the conversion. With this, it is easier
to detect errors than in a compiler. An interpreter
is faster than a compiler as it immediately executes
the code upon reading the code.
It is often used as a debugging tool for software
development as it can execute a single line of code
at a time. An interpreter is also more portable than
a compiler as it is not processor-dependent, you
can work between hardware architectures.
19
Interpreter
Translator Examples
Compiler
Microsoft Visual Studio
GNU Compiler Collection (GCC)
Common Business Oriented Language (COBOL)
Interpreter
OCaml
List Processing (LISP)
Python
Assembler
Fortran Assembly Program (FAP)
Macro Assembly Program (MAP)
Symbolic Optimal Assembly Program (SOAP)
20
1.TEXT EDITOR
A text editor is a type of computer program that edits plain text.
Such programs are sometimes known as "notepad" software,
following the naming of Microsoft Notepad. Text editors are
provided with operating systems and software development
packages, and can be used to change files such as configuration
files, documentation files and programming language source code
21
References
• https://teachcomputerscience.com/translators
• https://www.geeksforgeeks.org/difference-between-
high-level-and-low-level-languages/
• https://stackoverflow.com/questions/
• https://www.geeksforgeeks.org/difference-between-
procedural-and-declarative-knowledge/
• https://pediaa.com/what-is-the-difference-between-
structured-and-object-oriented
• https://www.quora.com/What-is-the-difference-
between-structured-programming-language-and-
object-oriented-programming
• https://www.geeksforgeeks.org/whats-the-difference-
between
• https://teachcomputerscience.com/translators
• https://en.wikipedia.org/wiki/Text_editor
22
1.
1.

More Related Content

What's hot

Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
Arslan Hussain
 
Programming languages
Programming languagesProgramming languages
Programming languages
www.myassignmenthelp.net
 
SYSTEM SOFTWARE
SYSTEM SOFTWARESYSTEM SOFTWARE
SYSTEM SOFTWAREKak Yong
 
Analog and Digital Computers
Analog and Digital ComputersAnalog and Digital Computers
Analog and Digital Computersiampencilbox
 
the Pitman Shorthand Chapter 1
the Pitman Shorthand Chapter 1the Pitman Shorthand Chapter 1
the Pitman Shorthand Chapter 1
RS CLASSES
 
History of computer
History of computerHistory of computer
History of computer
Shashiprabha Rathnayake
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Professor Lili Saghafi
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of Computer
AAKASH KUMAR
 
Computer programming
Computer programmingComputer programming
Computer programming
Vincent Valenzuela
 
Basic Concept of Computer
Basic Concept of ComputerBasic Concept of Computer
Basic Concept of Computer
Devendra Singh Rathod
 
What is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer DefinitionWhat is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer Definition
dmir3304
 
Programming language
Programming languageProgramming language
Programming language
RajThakuri
 
Command line interface “CLI”
Command line interface “CLI”Command line interface “CLI”
Command line interface “CLI”
abochoman
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
py7rjs
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Types of Computer on the basis of work
Types of Computer on the basis of workTypes of Computer on the basis of work
Types of Computer on the basis of work
Jitendra Shrestha
 
Software and its types
Software and its typesSoftware and its types
Software and its types
Ahmad Hussain
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Raja Hamid
 

What's hot (20)

The history of computers
The history of computersThe history of computers
The history of computers
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
SYSTEM SOFTWARE
SYSTEM SOFTWARESYSTEM SOFTWARE
SYSTEM SOFTWARE
 
Analog and Digital Computers
Analog and Digital ComputersAnalog and Digital Computers
Analog and Digital Computers
 
the Pitman Shorthand Chapter 1
the Pitman Shorthand Chapter 1the Pitman Shorthand Chapter 1
the Pitman Shorthand Chapter 1
 
History of computer
History of computerHistory of computer
History of computer
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of Computer
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Basic Concept of Computer
Basic Concept of ComputerBasic Concept of Computer
Basic Concept of Computer
 
Impress Ppt
Impress PptImpress Ppt
Impress Ppt
 
What is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer DefinitionWhat is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer Definition
 
Programming language
Programming languageProgramming language
Programming language
 
Command line interface “CLI”
Command line interface “CLI”Command line interface “CLI”
Command line interface “CLI”
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Types of Computer on the basis of work
Types of Computer on the basis of workTypes of Computer on the basis of work
Types of Computer on the basis of work
 
Software and its types
Software and its typesSoftware and its types
Software and its types
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 

Similar to Computer programming

notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals
ArghodeepPaul
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
Mohd Harris Ahmad Jaal
 
Language translators Of Programming in Computer science
Language translators Of Programming in Computer scienceLanguage translators Of Programming in Computer science
Language translators Of Programming in Computer science
RaianaTabitha
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
Muhammad Hammad Waseem
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
animewatcher7
 
Lecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxLecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptx
Chewe Lulembo
 
C++ programming languages lectures
C++ programming languages lectures C++ programming languages lectures
C++ programming languages lectures
jabirMemon
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
Sweta Kumari Barnwal
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
TamiratDejene1
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
Sehrish Rafiq
 
Ppt 1
Ppt 1Ppt 1
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Jaya Kumari
 
Computer programming
Computer programmingComputer programming
Computer programmingSuneel Dogra
 
Languages in computer
Languages in computerLanguages in computer
Languages in computer
The University of Lahore
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
Christ Association
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)Suneel Dogra
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
Ali Raza
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
PmarkNorcio
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
Kim Moore
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
Gaditek
 

Similar to Computer programming (20)

notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
 
Language translators Of Programming in Computer science
Language translators Of Programming in Computer scienceLanguage translators Of Programming in Computer science
Language translators Of Programming in Computer science
 
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
[ITP - Lecture 01] Introduction to Programming & Different Programming Languages
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
 
Lecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxLecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptx
 
C++ programming languages lectures
C++ programming languages lectures C++ programming languages lectures
C++ programming languages lectures
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Languages in computer
Languages in computerLanguages in computer
Languages in computer
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 

Recently uploaded

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 

Recently uploaded (20)

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 

Computer programming

  • 2. INTRODUCTION Mohamed Asarudeen Computer programming is the act of writing computer programs, which are a sequence of instructions written using a Computer Programming Language to perform a specified task by the computer. Computer Programming is fun and easy to learn provided you adopt a proper approach. This tutorial attempts to cover the basics of computer programming using a simple and practical approach for the benefit of novice learners. This EBook has been prepared for the beginners who are willing to learn computer programming but they are unable to learn it due to lack of proper guidance. Copyright & Disclaimer @ Copyright 2020 by N Mohamed Asarudeen. All the content and graphics published in this e-book are the property of N Mohamed Asarudeen. . The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. Mohamed Asardeen Asardeen68@gmail.com
  • 3. TABLE OF CONTENTSOVERVIEW 1…………………………………………..# INTRODUCTION OF THE PROGRAM 1.1………………........# INTRODUCTION TO COMPUTER PROGRAMMING…….……..# USES OF COMPUTER PROGRAM 1.3………………….……# COMPUTER PROGRAMMER 1.4………………….…..# ALGORITHM 1.5…………………………………………..# REPRESENTATION OF AN ALGORITHM................................# LOW LEVEL PROGRAMMING LANGUAGE 2..….# MACHINE LANGUAGE 2.1………………………………...# ASSEMBLY LANGUAGE 2.2………………………………..# HIGH LEVEL PROGRAMMING LANGUAGE 3..…# PROGRAMMING LANGUAGE TYPES 4….……….# SERVER SIDE PROGRAMMING 4.1…………...………….…# CLIENT SIDE PROGRAMMING 4.2…………………………# PROGRAMMING AND SCRIPTING……………….……..# LANGUAGE TRANSLATORS 5……..……………..# INTERPRETOR 5.1……………………………………...# COMPILER 5.2……………………………………….…# TEXT EDITOR 5.3………………………………………#
  • 4. 1.OVERVIEW 4 1.1 Introduction to Computer Program Before getting into computer programming, let us first understand computer programs and what they do. A computer program is a sequence of instructions written using a Computer Programming Language to perform a specified task by the computer. The two important terms that we have used in the above definition are: • Sequence of instructions • Computer Programming Language To understand these terms, consider a situation when someone asks you about how to go to a nearby KFC. What exactly do you do to tell him the way to go to KFC? You will use Human Language to tell the way to go to KFC, something as follows: Here, you have used English Language to give several steps to be taken to reach KFC. If they are followed in the following sequence, then you will reach KFC: 1. Go straight 2. Drive half kilometer 3. Take left 4. Drive around one kilometer 5. Search for KFC at your right side First go straight, after half kilometer, take left from the red light and then drive around one kilometer and you will find KFC at the right.
  • 5. 5 Now, try to map the situation with a computer program. The above sequence of instructions is actually a Human Program written in English Language, which instructs on how to reach KFC from a given starting point. This same sequence could have been given in Spanish, Hindi, Arabic, or any other human language, provided the person seeking direction knows any of these languages. Now, let's go back and try to understand a computer program, which is a sequence of instructions written in a Computer Language to perform a specified task by the computer. Following is a simple program written in Python programming Language: The above computer program instructs the computer to print "Hello, World!" on the computer screen. • A computer program is also called a computer software, which can range from two lines to millions of lines of instructions. • Computer program instructions are also called program source code and computer programming is also called program coding. • A computer without a computer program is just a dump box; it is programs that make computers active. As we have developed so many languages to communicate among ourselves, computer scientists have developed several computer- programming languages to provide instructions to the computer (i.e., to write computer programs). We will see several computer programming languages in the subsequent chapters. print "Hello, World!"
  • 6. 6 1.2 Introduction to Computer Programming 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
  • 7. 7 1.3 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. 1.4 Computer Programmer Someone who can write computer programs or in other words, someone who can do computer programming is called a Computer Programmer. Based on computer programming language expertise, we can name a computer programmers as follows: • C Programmer • C++ Programmer • Java Programmer • Python Programmer • PHP Programmer
  • 8. 8 1.5 Algorithm An algorithm is a method to show the steps in solving a problem. An algorithm is a step-by-step procedure for solving a problem. The need for this is to present a way to solve the problem with a plan. Example 1 - Let us develop an algorithm to post a letter. 1. Writing the letter 2. Folding the letter 3. Inserting the letter in an envelope 4. Writing the address 5. Sticking the stamp 6. Posting the letter Thus, a computer programmer lists down all the steps required to resolve a problem before writing the actual code. Following is a simple example of an algorithm to find out the largest number from a given list of numbers: The above algorithm has been written in a crude way to help beginners understand the concept. You will come across more standardized ways of writing computer algorithms as you move on to advanced levels of computer programming. 1. Get a list of numbers L1, L2, L3....LN 2. Assume L1 is the largest, Largest = L1 3. Take next number Li from the list and do the following 4. If Largest is less than Li 5. If Li is last number from the list then 6. Print value stored in Largest and come out
  • 9. 9 1.6 REPRESENTATION OFAN ALGORITHM Flowchart A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be defined as a diagrammatic representation of an algorithm, a step-by-step approach to solving a task. The symbols given in table are used to indicate different functions.
  • 10. 10 E.g. 1 - Finding the area of a circle. E.g. 2 - Finding whether a number is odd or even
  • 11. 2.LOWLEVELPROGRAMMING LANGUAGE 11 2.1 Machine Language Sometimes referred to as machine code or object code, machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. The exact machine language for a program or action can differ by operating system. The specific operating system dictates how a compiler writes a program or action into machine language. Machine language example Below is an example of machine language (binary) for the text "Hello World." Below is another example of machine language (non-binary), which prints the letter "A" 1000 times to the computer screen. 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 169 1 160 0 153 0 128 153 0 129 153 130 153 0 131 200 208 241 96
  • 12. 12 2.2 Assembly language Sometimes referred to as assembly or ASM, an assembly language is a low-level programming language. Programs written in assembly languages are compiled by an assembler. Every assembler has its own assembly language, which is designed for one specific computer architecture. Machine language is a series of numbers, which is not easy for humans to read. Using ASM, programmers can write human- readable programs that correspond almost exactly to machine language. Assembly is called a low-level programming language because there's (nearly) a one-to-one relationship between what it tells the computer to do, and what the computer does. In general, one line of an assembly program contains a maximum of one instruction for the computer.
  • 13. HIGHLEVELPROGRAMMING LANGUAGE 13 A high-level language (HLL) is a programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages. In contrast, assembly languages are considered low-level because they are very close to machine languages. Advantages of High-Level Languages • The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter. • The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Ada, Algol, BASIC, COBOL, C, C++, FORTRAN, LISP, Pascal, and Prolog.
  • 14. 14 4.1 Server-side Programming Server-side programming can be explained as: It is the general name for the kind of program that runs directly on the server. Or we can say that server-side programming must deal with dynamic content. It runs on the server. Most web pages are not static since they deal with searching databases. Server-side Uses • It processes the user input • Displays the requested pages • Structure of web applications • Interaction with servers/storages • Interaction with databases • Querying the database • Encoding of data into HTML • Operations over databases like delete, update. • Server-side Languages Example There are several languages that can be used for server-side programming: • PHP • ASP.NET (C# OR Visual Basic) • C++ • Java and JSP • Python • Ruby on Rails and so on. PROGRAMMINGLANGUAGE TYPES
  • 15. 4.2 Client-side Programming Similarly to server-side programming, client-side programming is also the name of the entire program that runs on the client. Or we can say that client-side programming mostly deals with the user interface with which the user interacts in the web. It is mostly a browser, in the user's machine, that runs the code and is mainly done in any scripting language like JavaScript (or we can use Flash instead of JavaScript or VNScript). Client-side Uses • Makes interactive web pages • Make stuff work dynamically • Interact with temporary storage • Sends requests to the server • Retrieval of data from Server • Interact with local storage • Provides remote access for client-server program • Client-side Languages Example • Works as an interface between user and server There are many client-side scripting languages too. • JavaScript • VBScript • HTML (Structure) • CSS (Designing) • AJAX etc.
  • 16. 16 A translator is a programming language processor that converts a computer program from one language to another. It takes a program written in source code and converts it into machine code. It discovers and identifies the error during translation. Purpose of Translator It translates high-level language program into a machine language program that the central processing unit (CPU) can understand. It also detects errors in the program. All of the above work in some way towards getting a high- level programming language translated into machine code that the central processing unit (CPU) can understand. Examples of CPUs include those made by Intel (e.g., x86), AMD (e.g., Athlon APU), NXP (e.g., PowerPC), and many others. It’s important to note that all translators, compilers, interpreters and assemblers are programs themselves. 5. LANGUAGETRANSLATORS
  • 17. 17 Assembler: Assembler is the language translator designed to translate assembly language program (source codes) into machine language program (object codes). The original assembly language program codes are called source codes and after translation, the nal machine language program codes are called object codes. Compiler A compiler is a translator used to convert high-level programming language to low-level programming language. It converts the whole program in one session and reports errors detected after the conversion. Compiler takes time to do its work as it translates high- level code to lower-level code all at once and then saves it to memory. A compiler is processor-dependent and platform-dependent. But it has been addressed by a special compiler, a cross-compiler and a source-to-source compiler. Before choosing a compiler, user has to identify first the Instruction Set Architecture (ISA), the operating system (OS) and the programming language that will be used to ensure that it will be compatible. .
  • 18. 18 Compiler Interpreter Just like a compiler, is a translator used to convert high-level programming language to low-level programming language. It converts the program one at a time and reports errors detected at once, while doing the conversion. With this, it is easier to detect errors than in a compiler. An interpreter is faster than a compiler as it immediately executes the code upon reading the code. It is often used as a debugging tool for software development as it can execute a single line of code at a time. An interpreter is also more portable than a compiler as it is not processor-dependent, you can work between hardware architectures.
  • 19. 19 Interpreter Translator Examples Compiler Microsoft Visual Studio GNU Compiler Collection (GCC) Common Business Oriented Language (COBOL) Interpreter OCaml List Processing (LISP) Python Assembler Fortran Assembly Program (FAP) Macro Assembly Program (MAP) Symbolic Optimal Assembly Program (SOAP)
  • 20. 20 1.TEXT EDITOR A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software, following the naming of Microsoft Notepad. Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code
  • 21. 21 References • https://teachcomputerscience.com/translators • https://www.geeksforgeeks.org/difference-between- high-level-and-low-level-languages/ • https://stackoverflow.com/questions/ • https://www.geeksforgeeks.org/difference-between- procedural-and-declarative-knowledge/ • https://pediaa.com/what-is-the-difference-between- structured-and-object-oriented • https://www.quora.com/What-is-the-difference- between-structured-programming-language-and- object-oriented-programming • https://www.geeksforgeeks.org/whats-the-difference- between • https://teachcomputerscience.com/translators • https://en.wikipedia.org/wiki/Text_editor
  • 22. 22 1.
  • 23. 1.