SlideShare a Scribd company logo
1 of 25
Introduction to Computer
Lecture # 12
Course Instructor : Sehrish Rafiq
Govt. Girls Degree College Maneri Swabi
Higher Education Department KP
Lecture Overview
 Problem Solving
 Algorithm
 Flow Chart
 Programming
 Computer Languages
 Low Level Languages
 High Level Languages
Steps of solving a problem
 Identify, analyze and define the problem
 Design algorithm
 Draw Flow chart
 Transform the algorithm in to a computer program
 Test and debug the code
 Execute and save the program
Algorithm
 An algorithm is a step by step method of solving a problem.
 It is a detailed series of instructions for carrying out an operation or solving
a problem.
 Algorithms must have finite number of steps and should be completed in
finite time.
 These steps / instructions should be carried out in sequence defined by the
programmer.
 An algorithm should be defined in such a way that it reflect a clear picture
of the solution to the problem.
 We use algorithms in everyday tasks also, such as a recipe to bake a cake or
plan for going to college.
Continued…
 Algorithms do not follow any programming language.
 They can be written in simple English or using special notation
(pseudocode symbols).
 Algorithm cannot be executed on computer without converting it in
to program.
 To make a computer do anything, the algorithm has to be converted
in to a computer program.
 The computer then "executes" the program, following each step
mechanically, to accomplish the end goal.
Algorithm for adding two numbers
Step 1 :- Print “Enter any two numbers”
Step 2 :- Input a
Step 3 :- Input b
Step 4 :- Sum:= a + b
Step 5 :- Display Sum
Step 6 :- Exit
Flow Chart
 A flow chart is a graphical or symbolic representation of the steps of
an algorithm.
 Each step in the algorithm is represented by a different geometrical
symbol which contains a short description of the step.
 These symbols are linked together with arrows showing the
algorithm flow.
Flow Chart Symbols
Flow Chart Example
Start
Stop
Input a
Input b
Print “Enter any
two numbers”
Sum:= a + b
Display Sum
Programming
 Programming is the process of writing instructions in a particular
programming language for a computer to perform some specific activity.
 These set of instructions are known as programs and are stored in
computer memory.
 Before execution data and programs must be loaded in to RAM.
 When programs are executed, they produce the desired result.
 Program / set of programs are also known as software.
Program in C
# include< iostream.h >
#include< conio.h >
void main( )
{ int a, b, sum;
cout<<“Print any two numbers”<<endl;
cin>> a; cin>>b;
sum=a+b;
cout<< “Sum=”<<sum;
getch();
}
Computer Languages
 Language is a source of communication between human beings.
 Similarly, a programming language is a source of communication between
the programmer and computer.
 A programming language is a vocabulary and set of grammatical rules for
instructing a computer or computing device to perform specific tasks.
 Each programming language has a unique set of keywords (words that its
translator understands) and a special syntax for organizing program
instructions.
 The programmers have to write their code according to the rules specified
by the particular programming language, they are using.
Continued…
 There are two types of computer languages.
 Low Level languages
 High Level languages
Computer Languages
Low Level Languages
 Low level languages are machine codes or close to it.
 They are machine dependent or hardware architecture dependent which
means that programs written in a low level language on one type of
computer cannot be executed on another type of computer.
 There are two types of low level languages.
 Machine Language
 Assembly Language
Machine language
 Machine language is the lowest and most elementary language and is the
first type of programming language developed.
 Machine language is basically the only language which a computer can
understand.
 In fact, a manufacturer designs a computer to obey just one language, its
machine code, which is represented inside the computer by a string of
binary digits (bits) 0 and 1.
 The symbol 0 stand for the absence of an electric pulse and 1 for the
presence of an electric pulse.
 Since a computer is capable of recognizing electric signals, therefore, it
understands machine language.
 The set of binary codes which can be recognize by the computer is known
as its machine code instruction set.
Continued…
 A machine language instruction consists of an operation code and one or
more operands.
 The operation code specifies the operation to be performed e.g. read, record
etc.
 Operands identify the quantities to be operated on e.g. the numbers to be
added or the locations where data are stored.
 But, it is almost impossible to write programs directly in machine code.
 For this reason, programs are normally written in assembly or high level
languages and then are translated in the machine language by different
translators.
Machine Language
Advantages
 It makes fast and efficient use of the computer
 It requires no translator to translate the code i.e. directly understood
by the computer.
Disadvantages
 All operation codes have to be remembered
 All memory addresses have to be remembered
 It is hard to amend or find errors in a program written in the machine
language
 These languages are machine dependent i.e. a particular machine
language can be used on only one type of computer.
Assembly Language
 Assembly language was developed to overcome the problems of machine
language programmers.
 In Assembly language operation codes and operands are given in the form
of alphanumeric symbols instead of 0’s and 1’s.
 These alphanumeric symbols are known as mnemonic codes and can have
maximum up to 5 letter combinations e.g. ADD, SUB, MUL, DIV, JUMP,
LOAD, STORE, START, LABEL etc.
 Assembly language is also known as “Symbolic Programming Language”.
 Assembly language is also machine dependent like machine language which
means that assembly language code written for one machine cannot be
executed by another machine.
Continued…
 This language is very difficult and needs a lot of practice to master it
because very small English support is given..
 The instructions of the assembly language will also be converted to
machine codes by assembler to be executed by the computer.
Assembly Language
Advantages
 It is easier to understand and use as compared to machine language.
 It is easy to locate and correct errors.
 It is modified easily as compared to machine language.
Disadvantages
 Like machine language it is also machine dependent
 Since it is machine dependent, there programmer should have the
knowledge of he hardware also.
High Level Language
 High level computer languages give formats close to English language.
 The purpose of developing high level languages is to enable people to
write programs easily and in their own native language environment
(English).
 High-level languages are basically symbolic languages that use English
words and/or mathematical symbols rather than mnemonic codes.
 Each instruction in the high level language is translated into many
machine language instructions thus showing one-to-many translation.
 Examples of High Level Languages are :- C, C++,C#, Java, Python etc.
Advantages
 User-friendly (people based).
 Similar to English with vocabulary of words awl symbols therefore it is
easier to learn.
 They require less time to write.
 They are easier to maintain.
 Problem oriented' rather than 'machine' based.
 Shorter than their low-level equivalents, One statement translates into
many machine code instructions.
 It is independent of the machine on which it used i.e. programs developed
in high level language can be run on any computer for which there exists an
appropriate translator.
Disadvantages
 A high-level language has to be translated into the -machine language by a
translator and thus a price in computer time is paid.
 The object code generated by a translator might be inefficient compared to
an equivalent assembly language program.
Introduction to Computer Programming Lecture 12

More Related Content

What's hot

Introduction to Computers Lecture # 8
Introduction to Computers Lecture # 8Introduction to Computers Lecture # 8
Introduction to Computers Lecture # 8Sehrish Rafiq
 
Bba i-introduction to computer-u-2- application and system software
Bba  i-introduction to computer-u-2- application and system softwareBba  i-introduction to computer-u-2- application and system software
Bba i-introduction to computer-u-2- application and system softwareRai University
 
1 fundamentals of computer system
1 fundamentals of computer system1 fundamentals of computer system
1 fundamentals of computer systemBaliThorat1
 
Introduction to Computers Lecture # 1
Introduction to Computers Lecture # 1Introduction to Computers Lecture # 1
Introduction to Computers Lecture # 1Sehrish Rafiq
 
Computer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsComputer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsVarshaSivashanker
 
system software and application software, compiler, interpreter & assembler
system software  and application software, compiler, interpreter & assemblersystem software  and application software, compiler, interpreter & assembler
system software and application software, compiler, interpreter & assemblerchetan birla
 
Unit 2 computer software
Unit 2 computer softwareUnit 2 computer software
Unit 2 computer softwareHardik Patel
 
Neethu Narayanan- Operating System
 Neethu Narayanan- Operating System Neethu Narayanan- Operating System
Neethu Narayanan- Operating System19940213
 
Computer generation and classification
Computer generation and classificationComputer generation and classification
Computer generation and classificationBaliThorat1
 
Computer Programs & System Softwares
Computer Programs & System SoftwaresComputer Programs & System Softwares
Computer Programs & System SoftwaresAbijah Naresh Jumani
 
Introduction to Computers Lecture # 3
Introduction to Computers Lecture # 3Introduction to Computers Lecture # 3
Introduction to Computers Lecture # 3Sehrish Rafiq
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
8 operating system concept
8 operating system concept8 operating system concept
8 operating system conceptBaliThorat1
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 

What's hot (20)

Introduction to Computers Lecture # 8
Introduction to Computers Lecture # 8Introduction to Computers Lecture # 8
Introduction to Computers Lecture # 8
 
Software
SoftwareSoftware
Software
 
Bba i-introduction to computer-u-2- application and system software
Bba  i-introduction to computer-u-2- application and system softwareBba  i-introduction to computer-u-2- application and system software
Bba i-introduction to computer-u-2- application and system software
 
1 fundamentals of computer system
1 fundamentals of computer system1 fundamentals of computer system
1 fundamentals of computer system
 
Introduction to Computers Lecture # 1
Introduction to Computers Lecture # 1Introduction to Computers Lecture # 1
Introduction to Computers Lecture # 1
 
Computer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translatorsComputer-charecteristics,types of languages,translators
Computer-charecteristics,types of languages,translators
 
system software and application software, compiler, interpreter & assembler
system software  and application software, compiler, interpreter & assemblersystem software  and application software, compiler, interpreter & assembler
system software and application software, compiler, interpreter & assembler
 
Unit 2 computer software
Unit 2 computer softwareUnit 2 computer software
Unit 2 computer software
 
Neethu Narayanan- Operating System
 Neethu Narayanan- Operating System Neethu Narayanan- Operating System
Neethu Narayanan- Operating System
 
Computer generation and classification
Computer generation and classificationComputer generation and classification
Computer generation and classification
 
Computer Programs & System Softwares
Computer Programs & System SoftwaresComputer Programs & System Softwares
Computer Programs & System Softwares
 
Introduction to Computers Lecture # 3
Introduction to Computers Lecture # 3Introduction to Computers Lecture # 3
Introduction to Computers Lecture # 3
 
Software
SoftwareSoftware
Software
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Introduction to Computer System
Introduction to Computer SystemIntroduction to Computer System
Introduction to Computer System
 
Language processors
Language processorsLanguage processors
Language processors
 
8 operating system concept
8 operating system concept8 operating system concept
8 operating system concept
 
SYSTEM SOFTWARE
SYSTEM SOFTWARE SYSTEM SOFTWARE
SYSTEM SOFTWARE
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Software
SoftwareSoftware
Software
 

Similar to Introduction to Computer Programming Lecture 12

Software programming and development
Software programming and developmentSoftware programming and development
Software programming and developmentAli Raza
 
[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
 
Computer programming
Computer programmingComputer programming
Computer programmingSuneel Dogra
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Arslan Hussain
 
Programming languages
Programming languagesProgramming languages
Programming languagesgaurav jain
 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptxgaafergoda
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)nharsh2308
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptxVishwas459764
 
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
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide shareSudhaa Ravi
 
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptxAnithaTAssistantProf
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxHariharPaudel1
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNoel Malle
 

Similar to Introduction to Computer Programming Lecture 12 (20)

Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
[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
 
Computer programming
Computer programmingComputer programming
Computer programming
 
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
 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptx
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
 
Computer program, computer languages, computer software
Computer program, computer languages, computer softwareComputer program, computer languages, computer software
Computer program, computer languages, computer software
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
 
Unit 1
Unit 1Unit 1
Unit 1
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 
df
dfdf
df
 
Introduction to C Programming Language.pptx
Introduction to C Programming Language.pptxIntroduction to C Programming Language.pptx
Introduction to C Programming Language.pptx
 
Program, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptxProgram, Programming and Programming Language.pptx
Program, Programming and Programming Language.pptx
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 

More from Sehrish Rafiq

Introduction to Computers Lecture # 14
Introduction to Computers Lecture # 14Introduction to Computers Lecture # 14
Introduction to Computers Lecture # 14Sehrish Rafiq
 
Introduction to Computers Lecture # 13
Introduction to Computers Lecture # 13Introduction to Computers Lecture # 13
Introduction to Computers Lecture # 13Sehrish Rafiq
 
Introduction to Computers Lecture # 10
Introduction to Computers Lecture # 10Introduction to Computers Lecture # 10
Introduction to Computers Lecture # 10Sehrish Rafiq
 
Introduction to Computers Lecture # 9
Introduction to Computers Lecture # 9Introduction to Computers Lecture # 9
Introduction to Computers Lecture # 9Sehrish Rafiq
 
Introduction to Computers Lecture # 7
Introduction to Computers Lecture # 7Introduction to Computers Lecture # 7
Introduction to Computers Lecture # 7Sehrish Rafiq
 
Introduction to computers Lecture # 4
Introduction to computers Lecture # 4Introduction to computers Lecture # 4
Introduction to computers Lecture # 4Sehrish Rafiq
 
Introduction to Computers Lecture # 2
Introduction to Computers Lecture # 2Introduction to Computers Lecture # 2
Introduction to Computers Lecture # 2Sehrish Rafiq
 
Data Communications and Networking Lecture 16
Data Communications and Networking Lecture 16Data Communications and Networking Lecture 16
Data Communications and Networking Lecture 16Sehrish Rafiq
 

More from Sehrish Rafiq (20)

Introduction to Computers Lecture # 14
Introduction to Computers Lecture # 14Introduction to Computers Lecture # 14
Introduction to Computers Lecture # 14
 
Introduction to Computers Lecture # 13
Introduction to Computers Lecture # 13Introduction to Computers Lecture # 13
Introduction to Computers Lecture # 13
 
Introduction to Computers Lecture # 10
Introduction to Computers Lecture # 10Introduction to Computers Lecture # 10
Introduction to Computers Lecture # 10
 
Introduction to Computers Lecture # 9
Introduction to Computers Lecture # 9Introduction to Computers Lecture # 9
Introduction to Computers Lecture # 9
 
Introduction to Computers Lecture # 7
Introduction to Computers Lecture # 7Introduction to Computers Lecture # 7
Introduction to Computers Lecture # 7
 
Introduction to computers Lecture # 4
Introduction to computers Lecture # 4Introduction to computers Lecture # 4
Introduction to computers Lecture # 4
 
Introduction to Computers Lecture # 2
Introduction to Computers Lecture # 2Introduction to Computers Lecture # 2
Introduction to Computers Lecture # 2
 
Data Communications and Networking Lecture 16
Data Communications and Networking Lecture 16Data Communications and Networking Lecture 16
Data Communications and Networking Lecture 16
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 07
Lecture 07Lecture 07
Lecture 07
 
Lecture 03
Lecture 03Lecture 03
Lecture 03
 
Lecture 06
Lecture 06Lecture 06
Lecture 06
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Introduction to Computer Programming Lecture 12

  • 1. Introduction to Computer Lecture # 12 Course Instructor : Sehrish Rafiq Govt. Girls Degree College Maneri Swabi Higher Education Department KP
  • 2. Lecture Overview  Problem Solving  Algorithm  Flow Chart  Programming  Computer Languages  Low Level Languages  High Level Languages
  • 3. Steps of solving a problem  Identify, analyze and define the problem  Design algorithm  Draw Flow chart  Transform the algorithm in to a computer program  Test and debug the code  Execute and save the program
  • 4. Algorithm  An algorithm is a step by step method of solving a problem.  It is a detailed series of instructions for carrying out an operation or solving a problem.  Algorithms must have finite number of steps and should be completed in finite time.  These steps / instructions should be carried out in sequence defined by the programmer.  An algorithm should be defined in such a way that it reflect a clear picture of the solution to the problem.  We use algorithms in everyday tasks also, such as a recipe to bake a cake or plan for going to college.
  • 5. Continued…  Algorithms do not follow any programming language.  They can be written in simple English or using special notation (pseudocode symbols).  Algorithm cannot be executed on computer without converting it in to program.  To make a computer do anything, the algorithm has to be converted in to a computer program.  The computer then "executes" the program, following each step mechanically, to accomplish the end goal.
  • 6. Algorithm for adding two numbers Step 1 :- Print “Enter any two numbers” Step 2 :- Input a Step 3 :- Input b Step 4 :- Sum:= a + b Step 5 :- Display Sum Step 6 :- Exit
  • 7. Flow Chart  A flow chart is a graphical or symbolic representation of the steps of an algorithm.  Each step in the algorithm is represented by a different geometrical symbol which contains a short description of the step.  These symbols are linked together with arrows showing the algorithm flow.
  • 9. Flow Chart Example Start Stop Input a Input b Print “Enter any two numbers” Sum:= a + b Display Sum
  • 10. Programming  Programming is the process of writing instructions in a particular programming language for a computer to perform some specific activity.  These set of instructions are known as programs and are stored in computer memory.  Before execution data and programs must be loaded in to RAM.  When programs are executed, they produce the desired result.  Program / set of programs are also known as software.
  • 11. Program in C # include< iostream.h > #include< conio.h > void main( ) { int a, b, sum; cout<<“Print any two numbers”<<endl; cin>> a; cin>>b; sum=a+b; cout<< “Sum=”<<sum; getch(); }
  • 12. Computer Languages  Language is a source of communication between human beings.  Similarly, a programming language is a source of communication between the programmer and computer.  A programming language is a vocabulary and set of grammatical rules for instructing a computer or computing device to perform specific tasks.  Each programming language has a unique set of keywords (words that its translator understands) and a special syntax for organizing program instructions.  The programmers have to write their code according to the rules specified by the particular programming language, they are using.
  • 13. Continued…  There are two types of computer languages.  Low Level languages  High Level languages
  • 15. Low Level Languages  Low level languages are machine codes or close to it.  They are machine dependent or hardware architecture dependent which means that programs written in a low level language on one type of computer cannot be executed on another type of computer.  There are two types of low level languages.  Machine Language  Assembly Language
  • 16. Machine language  Machine language is the lowest and most elementary language and is the first type of programming language developed.  Machine language is basically the only language which a computer can understand.  In fact, a manufacturer designs a computer to obey just one language, its machine code, which is represented inside the computer by a string of binary digits (bits) 0 and 1.  The symbol 0 stand for the absence of an electric pulse and 1 for the presence of an electric pulse.  Since a computer is capable of recognizing electric signals, therefore, it understands machine language.  The set of binary codes which can be recognize by the computer is known as its machine code instruction set.
  • 17. Continued…  A machine language instruction consists of an operation code and one or more operands.  The operation code specifies the operation to be performed e.g. read, record etc.  Operands identify the quantities to be operated on e.g. the numbers to be added or the locations where data are stored.  But, it is almost impossible to write programs directly in machine code.  For this reason, programs are normally written in assembly or high level languages and then are translated in the machine language by different translators.
  • 18. Machine Language Advantages  It makes fast and efficient use of the computer  It requires no translator to translate the code i.e. directly understood by the computer. Disadvantages  All operation codes have to be remembered  All memory addresses have to be remembered  It is hard to amend or find errors in a program written in the machine language  These languages are machine dependent i.e. a particular machine language can be used on only one type of computer.
  • 19. Assembly Language  Assembly language was developed to overcome the problems of machine language programmers.  In Assembly language operation codes and operands are given in the form of alphanumeric symbols instead of 0’s and 1’s.  These alphanumeric symbols are known as mnemonic codes and can have maximum up to 5 letter combinations e.g. ADD, SUB, MUL, DIV, JUMP, LOAD, STORE, START, LABEL etc.  Assembly language is also known as “Symbolic Programming Language”.  Assembly language is also machine dependent like machine language which means that assembly language code written for one machine cannot be executed by another machine.
  • 20. Continued…  This language is very difficult and needs a lot of practice to master it because very small English support is given..  The instructions of the assembly language will also be converted to machine codes by assembler to be executed by the computer.
  • 21. Assembly Language Advantages  It is easier to understand and use as compared to machine language.  It is easy to locate and correct errors.  It is modified easily as compared to machine language. Disadvantages  Like machine language it is also machine dependent  Since it is machine dependent, there programmer should have the knowledge of he hardware also.
  • 22. High Level Language  High level computer languages give formats close to English language.  The purpose of developing high level languages is to enable people to write programs easily and in their own native language environment (English).  High-level languages are basically symbolic languages that use English words and/or mathematical symbols rather than mnemonic codes.  Each instruction in the high level language is translated into many machine language instructions thus showing one-to-many translation.  Examples of High Level Languages are :- C, C++,C#, Java, Python etc.
  • 23. Advantages  User-friendly (people based).  Similar to English with vocabulary of words awl symbols therefore it is easier to learn.  They require less time to write.  They are easier to maintain.  Problem oriented' rather than 'machine' based.  Shorter than their low-level equivalents, One statement translates into many machine code instructions.  It is independent of the machine on which it used i.e. programs developed in high level language can be run on any computer for which there exists an appropriate translator.
  • 24. Disadvantages  A high-level language has to be translated into the -machine language by a translator and thus a price in computer time is paid.  The object code generated by a translator might be inefficient compared to an equivalent assembly language program.