SlideShare a Scribd company logo
1 of 39
PROG0101 Fundamentals of Programming
1
PROG0101
FUNDAMENTALS OF PROGRAMMING
Chapter 2
Programming Languages
PROG0101 Fundamentals of Programming
2
Programming Languages
Topics
• Definition of Program, Computer Programming, and
Computer Programmer.
• Generations of Programming Language
• Types of Programming Language
PROG0101 Fundamentals of Programming
3
Programming Languages
Computer Program
• A program is a set of instructions following the rules
of the chosen language.
• Without programs, computers are useless.
• A program is like a recipe.
• It contains a list of ingredients (called variables) and
a list of directions (called statements) that tell the
computer what to do with the variables.
PROG0101 Fundamentals of Programming
4
Programming Languages
Programming Language
• A vocabulary and set of grammatical rules (syntax)
for instructing a computer to perform specific tasks.
• Programming languages can be used to create
computer programs.
• The term programming language usually refers to
high-level languages, such as BASIC, C, C++,
COBOL, FORTRAN, Ada, and Pascal.
PROG0101 Fundamentals of Programming
5
Programming Languages
Programming Language
• You eventually need to convert your program into
machine language so that the computer can
understand it.
• There are two ways to do this:
– Compile the program
– Interpret the program
PROG0101 Fundamentals of Programming
6
Programming Languages
Programming Language
• Compile is to transform a program written in a high-
level programming language from source code into
object code.
• This can be done by using a tool called compiler.
• A compiler reads the whole source code and
translates it into a complete machine code program
to perform the required tasks which is output as a
new file.
PROG0101 Fundamentals of Programming
7
Programming Languages
Programming Language
• Interpreter is a program that executes instructions
written in a high-level language.
• An interpreter reads the source code one instruction
or line at a time, converts this line into machine code
and executes it.
PROG0101 Fundamentals of Programming
8
Programming Languages
Computer Programming
• Computer programming is the process of writing,
testing, debugging/troubleshooting, and maintaining
the source code of computer programs.
• This source code is written in a programming
language like C++, JAVA, Perl etc.
PROG0101 Fundamentals of Programming
9
Programming Languages
Computer Programmer
• A programmer is someone who writes computer
program.
• Computer programmers write, test, and maintain
programs or software that tell the computer what to
do.
PROG0101 Fundamentals of Programming
10
Programming Languages
What Skills are Required to Become a
Programmer?
• Programming - Writing computer programs for
various purposes.
• Writing - Communicating effectively with others in
writing as indicated by the needs of the audience.
• Reading Comprehension - Understanding written
sentences and paragraphs in work-related
documents.
• Critical Thinking - Using logic and analysis to
identify the strengths and weaknesses of different
approaches.
PROG0101 Fundamentals of Programming
11
Programming Languages
What Skills are Required to Become a
Programmer?
• Computers and Electronics - Knowledge of electric
circuit boards, processors, chips, and computer
hardware and software, including applications and
programming.
• Mathematics - Knowledge of numbers, their
operations, and interrelationships including
arithmetic, algebra, geometry, calculus, statistics, and
their applications.
• Oral Expression - The ability to communicate
information and ideas in speaking so others will
understand.
PROG0101 Fundamentals of Programming
12
Programming Languages
What Skills are Required to Become a
Programmer?
• Oral Comprehension - The ability to listen to and
understand information and ideas presented through
spoken words and sentences.
• Written Expression - The ability to communicate
information and ideas in writing so others will
understand.
• Written Comprehension - The ability to read and
understand information and ideas presented in
writing.
PROG0101 Fundamentals of Programming
13
Programming Languages
What Skills are Required to Become a
Programmer?
• Deductive Reasoning - The ability to apply general
rules to specific problems to come up with logical
answers. It involves deciding if an answer makes
sense.
• Information Organization - Finding ways to
structure or classify multiple pieces of information.
PROG0101 Fundamentals of Programming
14
Programming Languages
Generations of Programming Language
• The first generation languages, or 1GL, are low-
level languages that are machine language.
• The second generation languages, or 2GL, are
also low-level languages that generally consist of
assembly languages.
• The third generation languages, or 3GL, are high-
level languages such as C.
PROG0101 Fundamentals of Programming
15
Programming Languages
Generations of Programming Language
• The fourth generation languages,
languages that consist of statements
or 4GL, are
similar to
statements in a human language. Fourth generation
languages are commonly used in database
programming and scripts.
• The fifth generation languages, or 5GL, are
programming languages that contain visual tools to
help develop a program. A good example of a fifth
generation language is Visual Basic.
PROG0101 Fundamentals of Programming
16
Programming Languages
Types of Programming Language
• There are three types of programming language:
– Machine language (Low-level language)
– Assembly language (Low-level language)
– High-level language
• Low-level languages are closer to the language used
by a computer, while high-level languages are closer
to human languages.
PROG0101 Fundamentals of Programming
17
Programming Languages
Machine Language
• Machine language is a collection of binary digits or
bits that the computer reads and interprets.
• Machine languages are the only languages
understood by computers.
• While easily understood by computers, machine
languages are almost impossible for humans to use
because they consist entirely of numbers.
PROG0101 Fundamentals of Programming
18
Programming Languages
Machine Language
Machine Language
169 1 160 0 153 0 128 153 0 129 153 130 153 0 131
200 208 241 96
High level language
5 FOR I=1 TO 1000: PRINT "A";: NEXT I
PROG0101 Fundamentals of Programming
19
Programming Languages
Machine Language
Example:
• Let us say that an electric toothbrush has a processor
and main memory.
• The processor can rotate the bristles left and right,
and can check the on/off switch.
• The machine instructions are one byte long, and
correspond to the following machine operations:
PROG0101 Fundamentals of Programming
20
Programming Languages
Machine Language
Machine Instruction Machine Operation
0000 0000 Stop
0000 0001 Rotate bristles left
0000 0010 Rotate bristles right
0000 0100 Go back to start of program
0000 1000 Skip next instruction if switch is off
PROG0101 Fundamentals of Programming
21
Programming Languages
Assembly Language
• A program written in assembly language consists of a
series of instructions mnemonics that correspond to a
stream of executable instructions, when translated by
an assembler, that can be loaded into memory and
executed.
• Assembly languages use keywords and symbols,
much like English, to form a programming language
but at the same time introduce a new problem.
PROG0101 Fundamentals of Programming
22
Programming Languages
Assembly Language
• The problem is that the computer doesn't understand
the assembly code, so we need a way to convert it to
machine code, which the computer does understand.
• Assembly language programs are translated into
machine language by a program called an
assembler.
PROG0101 Fundamentals of Programming
23
Programming Languages
Assembly Language
• Example:
– Machine language :
10110000 01100001
– Assembly language :
mov a1, #061h
– Meaning:
Move the hexadecimal value 61 (97 decimal) into
the processor register named "a1".
PROG0101 Fundamentals of Programming
24
Programming Languages
High Level Language
• High-level languages allow us to write computer
code using instructions resembling everyday spoken
language (for example: print, if, while) which are
then translated into machine language to be
executed.
• Programs written in a high-level language need to
be translated into machine language before they
can be executed.
• Some programming languages use a compiler to
perform this translation and others use an
interpreter.
PROG0101 Fundamentals of Programming
25
Programming Languages
High-Level Language
• Examples of High-level Language:
• ADA
• C
• C++
• JAVA
• BASIC
• COBOL
• PASCAL
• PHYTON
PROG0101 Fundamentals of Programming
26
Programming Languages
Comparisson
Machine Language Assembly Language High-level Languages
Time to execute Since it is the basic
language of the
computer, it does not
require any translation,
and hence ensures
better machine
efficiency. This means
the programs run
faster.
A program called an
‘assembler’ isrequired
to convert the program
into machine language.
Thus, it takes longer to
execute than a
machine language
program.
A program called a
compiler or interpreter
is required to convert
the program into
machine language.
Thus, it takes more
time for a computerto
execute.
Time to develop Needs a lot of skill,as
instructions are very
lengthy and complex.
Thus, it takes more
time to program.
Simpler to use than
machine language,
though instruction
codes must be
memorized. It takes
less time to develop
programs as compared
to machine language.
Easiest to use. Takes
less time to develop
programs and, hence,
ensures better program
efficiency.
PROG0101 Fundamentals of Programming
27
Programming Languages
BASIC
• Short for Beginner's All-purpose Symbolic
Instruction Code.
• Developed in the 1950s for teaching University
students to program and provided with every self-
respecting personal computer in the 1980s,
• BASIC has been the first programming language for
many programmers.
• It is also the foundation for Visual Basic.
PROG0101 Fundamentals of Programming
28
Programming Languages
BASIC
Example:
PRINT "Hello world!"
PROG0101 Fundamentals of Programming
29
Programming Languages
Visual Basic
• A programming language and environment
developed by Microsoft.
• Based on the BASIC language, Visual Basic was one
of the first products to provide a graphical
programming environment and a paint metaphor for
developing user interfaces.
PROG0101 Fundamentals of Programming
30
Programming Languages
Visual Basic
Example:
MsgBox"Hello, World!“
PROG0101 Fundamentals of Programming
31
Programming Languages
C
• Developed by Dennis Ritchie at Bell Labs in the mid
1970s.
• C is much closer to assembly language than are
most other high-level languages.
• The first major program written in C was the UNIX
operating system.
• The low-level nature of C, however, can make the
language difficult to use for some types of
applications.
PROG0101 Fundamentals of Programming
32
Programming Languages
C
Example:
#include <stdio.h>
intmain(void)
{
printf("hello, worldn");
return0;
}
PROG0101 Fundamentals of Programming
33
Programming Languages
C++
• A high-level programming language developed by
Bjarne Stroustrup at Bell Labs.
• C++ adds object-oriented features to its predecessor,
C.
• C++ is one of the most popular programming
language for graphical applications, such as those
that run in Windows and Macintosh environments.
PROG0101 Fundamentals of Programming
34
Programming Languages
C++
Example:
#include <iostream>
intmain()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
PROG0101 Fundamentals of Programming
35
Programming Languages
Pascal
• A high-level programming language developed by
Niklaus Wirth in the late 1960s.
• The language is named after Blaise Pascal, a
seventeenth-century French mathematician who
constructed one of the first mechanical adding
machines.
• It is a popular teaching language.
PROG0101 Fundamentals of Programming
36
Programming Languages
Pascal
Example:
ProgramHelloWorld(output);
begin
writeLn('Hello, World!')
end.
PROG0101 Fundamentals of Programming
37
Programming Languages
Java
• A high-level programming language developed by
Sun Microsystems.
• Java was originally called OAK, and was designed for
handheld devices and set-top boxes.
• Oak was unsuccessful so in 1995 Sun changed the
name to Java and modified the language to take
advantage of the burgeoning World Wide Web.
• Java is a general purpose programming language
with a number of features that make the language
well suited for use on the World Wide Web.
PROG0101 Fundamentals of Programming
Programming Languages
Java
Example:
/* *Outputs"Hello,World!"andthenexits*/ public
classHelloWorld {
publicstaticvoidmain(String[]args){
System.out.println("Hello, World!");
}
}
38
PROG0101 Fundamentals of Programming
39
Programming Languages
Choosing a Programming Language
Before you decide on what language to use, you should
consider the following:
• your server platform
• the server software you run
• your budget
• previous experience in programming
• the database you have chosen for your backend

More Related Content

Similar to PROG0101 Learn Programming Fundamentals

POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptxPmarkNorcio
 
Computer programming programming_langugages
Computer programming programming_langugagesComputer programming programming_langugages
Computer programming programming_langugageseShikshak
 
CH 01.pptx
CH 01.pptxCH 01.pptx
CH 01.pptxObsa2
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptxcrAmth
 
Cmp104 lec 6 computer lang
Cmp104 lec 6 computer langCmp104 lec 6 computer lang
Cmp104 lec 6 computer langkapil078
 
Cmp104 lec 6 computer lang
Cmp104 lec 6 computer langCmp104 lec 6 computer lang
Cmp104 lec 6 computer langkapil078
 
Computer programing 111 lecture 1
Computer programing 111 lecture 1 Computer programing 111 lecture 1
Computer programing 111 lecture 1 ITNet
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresNisarg Amin
 
EVALUTION OF COMPUTER LANGAGES
EVALUTION OF COMPUTER LANGAGESEVALUTION OF COMPUTER LANGAGES
EVALUTION OF COMPUTER LANGAGESNoorHameed6
 
Introduction to Programming Languages
Introduction to Programming LanguagesIntroduction to Programming Languages
Introduction to Programming Languageseducationfront
 
X-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdfX-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdfAlefya1
 
PPL_Unit01 for the insem study first year.pptx
PPL_Unit01 for the insem study first year.pptxPPL_Unit01 for the insem study first year.pptx
PPL_Unit01 for the insem study first year.pptxrockstarr066gj
 
Python-L1.pptx
Python-L1.pptxPython-L1.pptx
Python-L1.pptxDukeCalvin
 

Similar to PROG0101 Learn Programming Fundamentals (20)

POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Computer programming programming_langugages
Computer programming programming_langugagesComputer programming programming_langugages
Computer programming programming_langugages
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
 
CH 01.pptx
CH 01.pptxCH 01.pptx
CH 01.pptx
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
 
Cmp104 lec 6 computer lang
Cmp104 lec 6 computer langCmp104 lec 6 computer lang
Cmp104 lec 6 computer lang
 
Cmp104 lec 6 computer lang
Cmp104 lec 6 computer langCmp104 lec 6 computer lang
Cmp104 lec 6 computer lang
 
Computer programing 111 lecture 1
Computer programing 111 lecture 1 Computer programing 111 lecture 1
Computer programing 111 lecture 1
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
 
Lesson 2.pptx
Lesson 2.pptxLesson 2.pptx
Lesson 2.pptx
 
EVALUTION OF COMPUTER LANGAGES
EVALUTION OF COMPUTER LANGAGESEVALUTION OF COMPUTER LANGAGES
EVALUTION OF COMPUTER LANGAGES
 
10 lesson7
10 lesson710 lesson7
10 lesson7
 
Introduction to Programming Languages
Introduction to Programming LanguagesIntroduction to Programming Languages
Introduction to Programming Languages
 
X-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdfX-CS-8.0 Programming in C Language 2022-2023.pdf
X-CS-8.0 Programming in C Language 2022-2023.pdf
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
PPL_Unit01 for the insem study first year.pptx
PPL_Unit01 for the insem study first year.pptxPPL_Unit01 for the insem study first year.pptx
PPL_Unit01 for the insem study first year.pptx
 
Python-L1.pptx
Python-L1.pptxPython-L1.pptx
Python-L1.pptx
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

PROG0101 Learn Programming Fundamentals

  • 1. PROG0101 Fundamentals of Programming 1 PROG0101 FUNDAMENTALS OF PROGRAMMING Chapter 2 Programming Languages
  • 2. PROG0101 Fundamentals of Programming 2 Programming Languages Topics • Definition of Program, Computer Programming, and Computer Programmer. • Generations of Programming Language • Types of Programming Language
  • 3. PROG0101 Fundamentals of Programming 3 Programming Languages Computer Program • A program is a set of instructions following the rules of the chosen language. • Without programs, computers are useless. • A program is like a recipe. • It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables.
  • 4. PROG0101 Fundamentals of Programming 4 Programming Languages Programming Language • A vocabulary and set of grammatical rules (syntax) for instructing a computer to perform specific tasks. • Programming languages can be used to create computer programs. • The term programming language usually refers to high-level languages, such as BASIC, C, C++, COBOL, FORTRAN, Ada, and Pascal.
  • 5. PROG0101 Fundamentals of Programming 5 Programming Languages Programming Language • You eventually need to convert your program into machine language so that the computer can understand it. • There are two ways to do this: – Compile the program – Interpret the program
  • 6. PROG0101 Fundamentals of Programming 6 Programming Languages Programming Language • Compile is to transform a program written in a high- level programming language from source code into object code. • This can be done by using a tool called compiler. • A compiler reads the whole source code and translates it into a complete machine code program to perform the required tasks which is output as a new file.
  • 7. PROG0101 Fundamentals of Programming 7 Programming Languages Programming Language • Interpreter is a program that executes instructions written in a high-level language. • An interpreter reads the source code one instruction or line at a time, converts this line into machine code and executes it.
  • 8. PROG0101 Fundamentals of Programming 8 Programming Languages Computer Programming • Computer programming is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs. • This source code is written in a programming language like C++, JAVA, Perl etc.
  • 9. PROG0101 Fundamentals of Programming 9 Programming Languages Computer Programmer • A programmer is someone who writes computer program. • Computer programmers write, test, and maintain programs or software that tell the computer what to do.
  • 10. PROG0101 Fundamentals of Programming 10 Programming Languages What Skills are Required to Become a Programmer? • Programming - Writing computer programs for various purposes. • Writing - Communicating effectively with others in writing as indicated by the needs of the audience. • Reading Comprehension - Understanding written sentences and paragraphs in work-related documents. • Critical Thinking - Using logic and analysis to identify the strengths and weaknesses of different approaches.
  • 11. PROG0101 Fundamentals of Programming 11 Programming Languages What Skills are Required to Become a Programmer? • Computers and Electronics - Knowledge of electric circuit boards, processors, chips, and computer hardware and software, including applications and programming. • Mathematics - Knowledge of numbers, their operations, and interrelationships including arithmetic, algebra, geometry, calculus, statistics, and their applications. • Oral Expression - The ability to communicate information and ideas in speaking so others will understand.
  • 12. PROG0101 Fundamentals of Programming 12 Programming Languages What Skills are Required to Become a Programmer? • Oral Comprehension - The ability to listen to and understand information and ideas presented through spoken words and sentences. • Written Expression - The ability to communicate information and ideas in writing so others will understand. • Written Comprehension - The ability to read and understand information and ideas presented in writing.
  • 13. PROG0101 Fundamentals of Programming 13 Programming Languages What Skills are Required to Become a Programmer? • Deductive Reasoning - The ability to apply general rules to specific problems to come up with logical answers. It involves deciding if an answer makes sense. • Information Organization - Finding ways to structure or classify multiple pieces of information.
  • 14. PROG0101 Fundamentals of Programming 14 Programming Languages Generations of Programming Language • The first generation languages, or 1GL, are low- level languages that are machine language. • The second generation languages, or 2GL, are also low-level languages that generally consist of assembly languages. • The third generation languages, or 3GL, are high- level languages such as C.
  • 15. PROG0101 Fundamentals of Programming 15 Programming Languages Generations of Programming Language • The fourth generation languages, languages that consist of statements or 4GL, are similar to statements in a human language. Fourth generation languages are commonly used in database programming and scripts. • The fifth generation languages, or 5GL, are programming languages that contain visual tools to help develop a program. A good example of a fifth generation language is Visual Basic.
  • 16. PROG0101 Fundamentals of Programming 16 Programming Languages Types of Programming Language • There are three types of programming language: – Machine language (Low-level language) – Assembly language (Low-level language) – High-level language • Low-level languages are closer to the language used by a computer, while high-level languages are closer to human languages.
  • 17. PROG0101 Fundamentals of Programming 17 Programming Languages Machine Language • Machine language is a collection of binary digits or bits that the computer reads and interprets. • Machine languages are the only languages understood by computers. • While easily understood by computers, machine languages are almost impossible for humans to use because they consist entirely of numbers.
  • 18. PROG0101 Fundamentals of Programming 18 Programming Languages Machine Language Machine Language 169 1 160 0 153 0 128 153 0 129 153 130 153 0 131 200 208 241 96 High level language 5 FOR I=1 TO 1000: PRINT "A";: NEXT I
  • 19. PROG0101 Fundamentals of Programming 19 Programming Languages Machine Language Example: • Let us say that an electric toothbrush has a processor and main memory. • The processor can rotate the bristles left and right, and can check the on/off switch. • The machine instructions are one byte long, and correspond to the following machine operations:
  • 20. PROG0101 Fundamentals of Programming 20 Programming Languages Machine Language Machine Instruction Machine Operation 0000 0000 Stop 0000 0001 Rotate bristles left 0000 0010 Rotate bristles right 0000 0100 Go back to start of program 0000 1000 Skip next instruction if switch is off
  • 21. PROG0101 Fundamentals of Programming 21 Programming Languages Assembly Language • A program written in assembly language consists of a series of instructions mnemonics that correspond to a stream of executable instructions, when translated by an assembler, that can be loaded into memory and executed. • Assembly languages use keywords and symbols, much like English, to form a programming language but at the same time introduce a new problem.
  • 22. PROG0101 Fundamentals of Programming 22 Programming Languages Assembly Language • The problem is that the computer doesn't understand the assembly code, so we need a way to convert it to machine code, which the computer does understand. • Assembly language programs are translated into machine language by a program called an assembler.
  • 23. PROG0101 Fundamentals of Programming 23 Programming Languages Assembly Language • Example: – Machine language : 10110000 01100001 – Assembly language : mov a1, #061h – Meaning: Move the hexadecimal value 61 (97 decimal) into the processor register named "a1".
  • 24. PROG0101 Fundamentals of Programming 24 Programming Languages High Level Language • High-level languages allow us to write computer code using instructions resembling everyday spoken language (for example: print, if, while) which are then translated into machine language to be executed. • Programs written in a high-level language need to be translated into machine language before they can be executed. • Some programming languages use a compiler to perform this translation and others use an interpreter.
  • 25. PROG0101 Fundamentals of Programming 25 Programming Languages High-Level Language • Examples of High-level Language: • ADA • C • C++ • JAVA • BASIC • COBOL • PASCAL • PHYTON
  • 26. PROG0101 Fundamentals of Programming 26 Programming Languages Comparisson Machine Language Assembly Language High-level Languages Time to execute Since it is the basic language of the computer, it does not require any translation, and hence ensures better machine efficiency. This means the programs run faster. A program called an ‘assembler’ isrequired to convert the program into machine language. Thus, it takes longer to execute than a machine language program. A program called a compiler or interpreter is required to convert the program into machine language. Thus, it takes more time for a computerto execute. Time to develop Needs a lot of skill,as instructions are very lengthy and complex. Thus, it takes more time to program. Simpler to use than machine language, though instruction codes must be memorized. It takes less time to develop programs as compared to machine language. Easiest to use. Takes less time to develop programs and, hence, ensures better program efficiency.
  • 27. PROG0101 Fundamentals of Programming 27 Programming Languages BASIC • Short for Beginner's All-purpose Symbolic Instruction Code. • Developed in the 1950s for teaching University students to program and provided with every self- respecting personal computer in the 1980s, • BASIC has been the first programming language for many programmers. • It is also the foundation for Visual Basic.
  • 28. PROG0101 Fundamentals of Programming 28 Programming Languages BASIC Example: PRINT "Hello world!"
  • 29. PROG0101 Fundamentals of Programming 29 Programming Languages Visual Basic • A programming language and environment developed by Microsoft. • Based on the BASIC language, Visual Basic was one of the first products to provide a graphical programming environment and a paint metaphor for developing user interfaces.
  • 30. PROG0101 Fundamentals of Programming 30 Programming Languages Visual Basic Example: MsgBox"Hello, World!“
  • 31. PROG0101 Fundamentals of Programming 31 Programming Languages C • Developed by Dennis Ritchie at Bell Labs in the mid 1970s. • C is much closer to assembly language than are most other high-level languages. • The first major program written in C was the UNIX operating system. • The low-level nature of C, however, can make the language difficult to use for some types of applications.
  • 32. PROG0101 Fundamentals of Programming 32 Programming Languages C Example: #include <stdio.h> intmain(void) { printf("hello, worldn"); return0; }
  • 33. PROG0101 Fundamentals of Programming 33 Programming Languages C++ • A high-level programming language developed by Bjarne Stroustrup at Bell Labs. • C++ adds object-oriented features to its predecessor, C. • C++ is one of the most popular programming language for graphical applications, such as those that run in Windows and Macintosh environments.
  • 34. PROG0101 Fundamentals of Programming 34 Programming Languages C++ Example: #include <iostream> intmain() { std::cout << "Hello World!" << std::endl; return 0; }
  • 35. PROG0101 Fundamentals of Programming 35 Programming Languages Pascal • A high-level programming language developed by Niklaus Wirth in the late 1960s. • The language is named after Blaise Pascal, a seventeenth-century French mathematician who constructed one of the first mechanical adding machines. • It is a popular teaching language.
  • 36. PROG0101 Fundamentals of Programming 36 Programming Languages Pascal Example: ProgramHelloWorld(output); begin writeLn('Hello, World!') end.
  • 37. PROG0101 Fundamentals of Programming 37 Programming Languages Java • A high-level programming language developed by Sun Microsystems. • Java was originally called OAK, and was designed for handheld devices and set-top boxes. • Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web. • Java is a general purpose programming language with a number of features that make the language well suited for use on the World Wide Web.
  • 38. PROG0101 Fundamentals of Programming Programming Languages Java Example: /* *Outputs"Hello,World!"andthenexits*/ public classHelloWorld { publicstaticvoidmain(String[]args){ System.out.println("Hello, World!"); } } 38
  • 39. PROG0101 Fundamentals of Programming 39 Programming Languages Choosing a Programming Language Before you decide on what language to use, you should consider the following: • your server platform • the server software you run • your budget • previous experience in programming • the database you have chosen for your backend