SlideShare a Scribd company logo
1 of 18
DIFFERENT TYPES OF ERRORS
Compilation errors
• Error occurs when the compiler finds something in the source
code that it can’t compile.
• A misspelling, typographical error, or any of a dozen other
things can cause the compiler to choke.
• Hello.c:Error:’;’ expected
Linker error messages
• Relatively rare and usually result from misspelling the name of
a C library function.
• Error: undefined symbols: error message, followed by the
misspelled name (preceded by an underscore).
• Once you correct the spelling, the problem should go away.
Execution error
 Errors occur during the program execution, after a successful
compilation.
 Common execution errors are a numerical overflow or
underflow (exceeding the largest or smallest permissible
number that can be stored in the computer), division by zero,
attempting to compute the logarithm or the square root of a
negative number, etc.
 These diagnostics are sometimes called execution messages
or run-time messages.
 Logical Error
• Error done by programmer by giving different logical mistakes.
Logical error is not detected by the compiler.
• Syntax will be correct but the output of the program will be
different than that of expected output.
ASSEMBLERS, COMPILERS AND INTERPRETERS
 The assemblers, compilers, or interpreters are the software
that converts HLL to LLL.
 ASSEMBLER
 Language which substitutes letters and symbols for the
numbers in the machine language program is called an
assembly language or symbolic language.
 Program written in symbolic language that uses symbols
instead of numbers is called an assembly code or a symbolic
program.
 Translator program that translates an assembly code into the
computer’s machine code is called an assembler.
 ASSEMBLER
 Assembler is a system program which is supplied by the
computer manufacturer.
 Because in addition to translating the assembly code to
machine code, it also assembles the machine code in the
main memory of the computer and makes it ready for
execution.
 Symbolic program written by program in assembly language is
called a source program.
 After the source program has been converted into machine
language by an assembler, it is referred to as an object
program.
 Assembler translates each assembly language instructions into an
equivalent machine language instruction, there is a one-to-one
correspondence between the assembly instructions of the source
program and the machine instructions of object program.
 COMPILER
 Translating program that translates the instruction of a high level
language into machine language.
 Compiler translated the whole program at once and this process is
called compilation.
 Compiler can translate only those source programs which have
been written in the language for which the computer is meant.
 Compilers are large programs which reside permanently on
secondary storage.
 When the translation of a program is to be done, they are
copied into the main memory of the computer.
 Compiler analyses each statement in the source program and
generates a sequence of machine instructions, when
executed, will precisely carry out the computation specified in
the statement.
 As the compiler analyses each statement, it may detects
certain types of errors, which are called compile time errors.
 A source program containing an error diagnosed by the
compiler will not be compiled into an object program.
 Compiler will print out a suitable message along with a list of
coded error messages which indicate the type of errors.
 Compiler, however, can not diagnose logical errors. It can only
diagnose syntax errors in a program.
INTERPRETER
 An interpreter is another type of translator used for
translating high level languages into machine code.
 Takes the statement of a high level language and translates it
into a machine instruction which is immediately executed.
 During programming, programmer can not proceed to next
line till the current line is error free.
 Advantage of an interpreter over a compiler is fast response
to changes in the source program.
 It is a time consuming translation method because each
statement must be translated every time it is executed from
the source program.
 Compiled machine language program runs much faster than
an interpreted program.
ALGORITHMS
 Algorithm is a verbal or says written form of the program. It can
also be defined as ordered description of instructions to be carried
out in order to solve the given task.
 For example:
• Program: preparing tea
• Start
• Fetch water and tea leaves along with sugar and milk
• Boil the water
• Put tea leaves and sugar in boiled water
• Mix with milk
• Server the tea
• Stop
Basic guidelines for writing Algorithms
 Use plain language.
 Do not use any language specific syntax. Same algorithm
should hold true for any programming language.
 Do not make any assumptions. Describe everything clearly
and explicitly.
 Ensure that the algorithm has single entry and exit point.
Important features of Algorithm
 1. Finiteness: Every algorithm should lead to a session of
task that terminates after a finite number of steps.
 2. Definiteness: Each step must be precisely defined. Actions
should be unambiguously specified for each case.
 3. Inputs: Any algorithm can have zero or more inputs. Inputs
may be given initially or as the algorithm runs.
 4. Outputs: Any algorithm may result in one or more outputs.
Quantities that have specified relation to inputs.
 5. Effectiveness: All operations must be sufficiently basic so
as to be implemented with even paper and pencil.
For example: A procedure to pick the largest tender from a set of tenders
Step 1: Read the first tender and note down its value as the maximum
tender value so far encountered. Note down the tender
identification number.
Step 2: As long as tenders are not exhausted do steps 3 and 4. go to
step 5 when tenders are exhausted.
Step 3: Read the next tender and compare the tender with the current
maximum tender value.
Step 4: If this tender value is greater than that previously noted down
as maximum tender then erase the previous maximum value noted
and replace it by this new value. Replace the previously noted
tender identification number of this identification number. Else do
not do anything.
Step 5: Print the final value of maximum tender and its identification
noted down in step 4.
FLOWCHART
 Diagrammatic representation of algorithm.
 Flowchart represents the actual flow of program during
program execution.
 It is very helpful for debugging or tracing the flow of the
program.
 Flowchart is drawn using basic blocks, each having special
meaning.
 Basic blocks used for drawing flowcharts.
Structure / Purpose
Start/ Stop Processing
Decision
making
Input/ output
Conne
ctor

More Related Content

What's hot

Language translator
Language translatorLanguage translator
Language translatorasmakh89
 
Using Pseudocode Statements and Flowchart Symbols
Using Pseudocode Statements and Flowchart SymbolsUsing Pseudocode Statements and Flowchart Symbols
Using Pseudocode Statements and Flowchart SymbolsAr Kyu Dee
 
Understanding Computer Systems
Understanding Computer SystemsUnderstanding Computer Systems
Understanding Computer SystemsAr Kyu Dee
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreterParas Patel
 
Understanding Simple Program Logic
Understanding Simple Program LogicUnderstanding Simple Program Logic
Understanding Simple Program LogicAr Kyu Dee
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)Nazmul Hyder
 
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi  Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi Prof. (Dr.) Anand K. Tripathi
 
notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals ArghodeepPaul
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
Introduction to programming by MUFIX Commnity
Introduction to programming by MUFIX CommnityIntroduction to programming by MUFIX Commnity
Introduction to programming by MUFIX Commnitymazenet
 
Introduction to compiler interpreter
Introduction to compiler interpreterIntroduction to compiler interpreter
Introduction to compiler interpreterpoojapainter
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Md Hossen
 
compiler and their types
compiler and their typescompiler and their types
compiler and their typespatchamounika7
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorialVarsha Shukla
 
SDD Translation
SDD  TranslationSDD  Translation
SDD Translationgavhays
 
Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).JayminSuhagiya
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfDrIsikoIsaac
 

What's hot (20)

Language translator
Language translatorLanguage translator
Language translator
 
Using Pseudocode Statements and Flowchart Symbols
Using Pseudocode Statements and Flowchart SymbolsUsing Pseudocode Statements and Flowchart Symbols
Using Pseudocode Statements and Flowchart Symbols
 
Understanding Computer Systems
Understanding Computer SystemsUnderstanding Computer Systems
Understanding Computer Systems
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Understanding Simple Program Logic
Understanding Simple Program LogicUnderstanding Simple Program Logic
Understanding Simple Program Logic
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)
 
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi  Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
 
notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Introduction to programming by MUFIX Commnity
Introduction to programming by MUFIX CommnityIntroduction to programming by MUFIX Commnity
Introduction to programming by MUFIX Commnity
 
Introduction to compiler interpreter
Introduction to compiler interpreterIntroduction to compiler interpreter
Introduction to compiler interpreter
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
 
compiler and their types
compiler and their typescompiler and their types
compiler and their types
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorial
 
SDD Translation
SDD  TranslationSDD  Translation
SDD Translation
 
Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).Translators(compiler assembler interpretor).
Translators(compiler assembler interpretor).
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
Presentation
PresentationPresentation
Presentation
 

Similar to Unit 3.1 Algorithm and Flowchart

Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)nharsh2308
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overviewamudha arul
 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptxssuser3b4934
 
Computer assignment for grade 9
Computer assignment for grade  9Computer assignment for grade  9
Computer assignment for grade 9nahomyitbarek
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxAliyahAli19
 
compilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfcompilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfHarshaVardhan196987
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfDrIsikoIsaac
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler languageAshok Raj
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Sehrish Rafiq
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdfRakibRahman19
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction Thapar Institute
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfMMRF2
 
Programming Languages / Translators
Programming Languages / TranslatorsProgramming Languages / Translators
Programming Languages / TranslatorsProject Student
 
Basic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chartBasic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chartPrasanna R Kovath
 

Similar to Unit 3.1 Algorithm and Flowchart (20)

C programming
C programmingC programming
C programming
 
Introduction to programming language (basic)
Introduction to programming language (basic)Introduction to programming language (basic)
Introduction to programming language (basic)
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overview
 
Compiler vs interpreter
Compiler vs interpreter Compiler vs interpreter
Compiler vs interpreter
 
Phases of Compiler.pptx
Phases of Compiler.pptxPhases of Compiler.pptx
Phases of Compiler.pptx
 
Computer assignment for grade 9
Computer assignment for grade  9Computer assignment for grade  9
Computer assignment for grade 9
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
 
compilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdfcompilervsinterpreter-161008074915.pdf
compilervsinterpreter-161008074915.pdf
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
Programming Languages / Translators
Programming Languages / TranslatorsProgramming Languages / Translators
Programming Languages / Translators
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Basic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chartBasic syntax : Algorithm,Flow chart
Basic syntax : Algorithm,Flow chart
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
"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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
"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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 

Unit 3.1 Algorithm and Flowchart

  • 2. Compilation errors • Error occurs when the compiler finds something in the source code that it can’t compile. • A misspelling, typographical error, or any of a dozen other things can cause the compiler to choke. • Hello.c:Error:’;’ expected
  • 3. Linker error messages • Relatively rare and usually result from misspelling the name of a C library function. • Error: undefined symbols: error message, followed by the misspelled name (preceded by an underscore). • Once you correct the spelling, the problem should go away.
  • 4. Execution error  Errors occur during the program execution, after a successful compilation.  Common execution errors are a numerical overflow or underflow (exceeding the largest or smallest permissible number that can be stored in the computer), division by zero, attempting to compute the logarithm or the square root of a negative number, etc.  These diagnostics are sometimes called execution messages or run-time messages.
  • 5.  Logical Error • Error done by programmer by giving different logical mistakes. Logical error is not detected by the compiler. • Syntax will be correct but the output of the program will be different than that of expected output.
  • 6. ASSEMBLERS, COMPILERS AND INTERPRETERS  The assemblers, compilers, or interpreters are the software that converts HLL to LLL.  ASSEMBLER  Language which substitutes letters and symbols for the numbers in the machine language program is called an assembly language or symbolic language.  Program written in symbolic language that uses symbols instead of numbers is called an assembly code or a symbolic program.  Translator program that translates an assembly code into the computer’s machine code is called an assembler.
  • 7.  ASSEMBLER  Assembler is a system program which is supplied by the computer manufacturer.  Because in addition to translating the assembly code to machine code, it also assembles the machine code in the main memory of the computer and makes it ready for execution.  Symbolic program written by program in assembly language is called a source program.  After the source program has been converted into machine language by an assembler, it is referred to as an object program.
  • 8.  Assembler translates each assembly language instructions into an equivalent machine language instruction, there is a one-to-one correspondence between the assembly instructions of the source program and the machine instructions of object program.  COMPILER  Translating program that translates the instruction of a high level language into machine language.  Compiler translated the whole program at once and this process is called compilation.  Compiler can translate only those source programs which have been written in the language for which the computer is meant.
  • 9.  Compilers are large programs which reside permanently on secondary storage.  When the translation of a program is to be done, they are copied into the main memory of the computer.  Compiler analyses each statement in the source program and generates a sequence of machine instructions, when executed, will precisely carry out the computation specified in the statement.  As the compiler analyses each statement, it may detects certain types of errors, which are called compile time errors.
  • 10.  A source program containing an error diagnosed by the compiler will not be compiled into an object program.  Compiler will print out a suitable message along with a list of coded error messages which indicate the type of errors.  Compiler, however, can not diagnose logical errors. It can only diagnose syntax errors in a program.
  • 11. INTERPRETER  An interpreter is another type of translator used for translating high level languages into machine code.  Takes the statement of a high level language and translates it into a machine instruction which is immediately executed.  During programming, programmer can not proceed to next line till the current line is error free.  Advantage of an interpreter over a compiler is fast response to changes in the source program.  It is a time consuming translation method because each statement must be translated every time it is executed from the source program.
  • 12.  Compiled machine language program runs much faster than an interpreted program.
  • 13. ALGORITHMS  Algorithm is a verbal or says written form of the program. It can also be defined as ordered description of instructions to be carried out in order to solve the given task.  For example: • Program: preparing tea • Start • Fetch water and tea leaves along with sugar and milk • Boil the water • Put tea leaves and sugar in boiled water • Mix with milk • Server the tea • Stop
  • 14. Basic guidelines for writing Algorithms  Use plain language.  Do not use any language specific syntax. Same algorithm should hold true for any programming language.  Do not make any assumptions. Describe everything clearly and explicitly.  Ensure that the algorithm has single entry and exit point.
  • 15. Important features of Algorithm  1. Finiteness: Every algorithm should lead to a session of task that terminates after a finite number of steps.  2. Definiteness: Each step must be precisely defined. Actions should be unambiguously specified for each case.  3. Inputs: Any algorithm can have zero or more inputs. Inputs may be given initially or as the algorithm runs.  4. Outputs: Any algorithm may result in one or more outputs. Quantities that have specified relation to inputs.  5. Effectiveness: All operations must be sufficiently basic so as to be implemented with even paper and pencil.
  • 16. For example: A procedure to pick the largest tender from a set of tenders Step 1: Read the first tender and note down its value as the maximum tender value so far encountered. Note down the tender identification number. Step 2: As long as tenders are not exhausted do steps 3 and 4. go to step 5 when tenders are exhausted. Step 3: Read the next tender and compare the tender with the current maximum tender value. Step 4: If this tender value is greater than that previously noted down as maximum tender then erase the previous maximum value noted and replace it by this new value. Replace the previously noted tender identification number of this identification number. Else do not do anything. Step 5: Print the final value of maximum tender and its identification noted down in step 4.
  • 17. FLOWCHART  Diagrammatic representation of algorithm.  Flowchart represents the actual flow of program during program execution.  It is very helpful for debugging or tracing the flow of the program.  Flowchart is drawn using basic blocks, each having special meaning.  Basic blocks used for drawing flowcharts.
  • 18. Structure / Purpose Start/ Stop Processing Decision making Input/ output Conne ctor