SlideShare a Scribd company logo
1 of 23
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

Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreterParas Patel
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languagesNaqashAhmad14
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNoel Malle
 
Programming language
Programming languageProgramming language
Programming languageShuja Qais
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 
computer languages
computer languagescomputer languages
computer languagesYasirali328
 
High level and Low level Language
High level and Low level Language High level and Low level Language
High level and Low level Language adnan usmani
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginnersClement Levallois
 
introduction computer programming languages
introduction computer programming languages introduction computer programming languages
introduction computer programming languages BakhatAli3
 
Computer Programming: Chapter 1
Computer Programming: Chapter 1Computer Programming: Chapter 1
Computer Programming: Chapter 1Atit Patumvan
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introductionRana Ehtisham Ul Haq
 
History of Programming Language
History of Programming LanguageHistory of Programming Language
History of Programming Languagetahria123
 
Programming language design and implemenation
Programming language design and implemenationProgramming language design and implemenation
Programming language design and implemenationAshwini Awatare
 

What's hot (20)

Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Computer languages
Computer languagesComputer languages
Computer languages
 
introduction to programming languages
introduction to programming languagesintroduction to programming languages
introduction to programming languages
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Programming language
Programming languageProgramming language
Programming language
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
computer languages
computer languagescomputer languages
computer languages
 
High level and Low level Language
High level and Low level Language High level and Low level Language
High level and Low level Language
 
Programming Language
Programming LanguageProgramming Language
Programming Language
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginners
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
introduction computer programming languages
introduction computer programming languages introduction computer programming languages
introduction computer programming languages
 
Computer Programming: Chapter 1
Computer Programming: Chapter 1Computer Programming: Chapter 1
Computer Programming: Chapter 1
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
History of Programming Language
History of Programming LanguageHistory of Programming Language
History of Programming Language
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Programming language design and implemenation
Programming language design and implemenationProgramming language design and implemenation
Programming language design and implemenation
 

Similar to Computer programming

notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals ArghodeepPaul
 
[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 LanguagesMuhammad Hammad Waseem
 
Lecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxLecture_1_Introduction_to_Programming.pptx
Lecture_1_Introduction_to_Programming.pptxChewe 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 softwareSweta Kumari Barnwal
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Sehrish Rafiq
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonJaya Kumari
 
Computer programming
Computer programmingComputer programming
Computer programmingSuneel Dogra
 
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 developmentAli Raza
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptxPmarkNorcio
 
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 JavaKim Moore
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 

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
 
[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
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 

Recently uploaded

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 

Recently uploaded (20)

Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 

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.