SlideShare a Scribd company logo
1 of 32
Download to read offline
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
McGraw-Hill Technology Education
McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
McGraw-Hill Technology Education
Chapter 13A
Creating Computer
Programs
13A-3
What Is a Computer Program?
• Computer programs
– Also called software
– Are a list of instructions
– Instructions are called code
– CPU performs the instructions
– Three types
• Operating system
• Utility
• Application
13A-4
Software Is Stored In Many Files
• Executable files
– Contain the instructions for the CPU
– Have extensions of .exe, or .com
13A-5
Software Is Stored In Many Files
• Dynamic link libraries
– Partial executable file
– Used to support executable files
– Have .dll extensions
13A-6
Software Is Stored In Many Files
• Initialization files
– Contain configuration settings for software
– Have a .ini extension
– Modern programs use the registry
13A-7
Software Is Stored In Many Files
• Help files
– Contain information about the software
– Information is indexed and searchable
– Provides an online manual
– Have a .chm or .hlp extension
13A-8
Software Is Stored In Many Files
• Batch files
– Used to automate tasks
– Hold a series of OS commands
– Have a .bat extension
13A-9
Hardware/Software Interaction
• Program execution
– Software executes at the CPU level
– Code to play a sound
• Code generates an interrupt
• CPU tells the sound card to play
• Sound card plays the file
– Programmer creates the code
13A-10
Hardware/Software Interaction
• Code
– Statements written in a programming
language
– Writing code can be tedious
• Code must be perfect
• Order of steps must be exact
– Writing code is quite exciting
• Problems are solved
• New ideas are formed
13A-11
Writing Code
13A-12
Hardware/Software Interaction
• Machine code
– Recall that computers think in binary
– Code is translated into machine code
• CPU executes the machine code
– CPUs have a unique machine code
13A-13
Hardware/Software Interaction
• Programming languages
– Simplifies the writing of code
• English is used to describe the binary
– Original code is called source code
– Several hundred languages exist
13A-14
Hardware/Software Interaction
• Compilers and interpreters
– Converts source code into binary
• Allows code to execute
– Checks source code for correctness
13A-15
Hardware/Software Interaction
• Compiler
– Creates an executable file
• Contents are called object code
– Executable can run on its own
– Each language has its own compiler
– C++ and Java are compiled languages
13A-16
Hardware/Software Interaction
• Interpreter
– Runs program one line at a time
– More flexible than compilers
– Slower than compilers
– Always needed to execute program
– Visual Basic and Perl are interpreted
13A-17
Planning a Computer Program
• Plans
– The steps to solve a problem
– Describe the expected results
– Programming without a plan is difficult
13A-18
Planning Tools
• Pseudo code
– Natural language statements that
resemble code
– Describes what must be done
– Can be written by non programmers
– Programmers develop unique versions
13A-19
Planning Tools
• Input-processing-output (IPO) charts
– Determines what is needed
– Input column
• Data inputted by the user
– Processing column
• Pseudo code describing the problem solution
– Output column
• Desired output from the program
13A-20
IPO Chart
13A-21
How Programs Solve Problems
• Program control flow
– Order program statements are executed
– Typically executed in order
– Constructs can change the flow
• Decision statements
• Loops
13A-22
How Programs Solve Problems
• Algorithm
– Set of steps
– Always leads to a solution
– Steps are always the same
– Flowcharts can describe algorithms
• Structured tool for drawing algorithms
– Algorithms appear in all programs
13A-23
Flowchart
13A-24
How Programs Solve Problems
• Heuristic
– Set of steps
– Solution is usually found
– Solution may not be optimal
– Used when algorithms fail
• Algorithm is nonexistent or too complex
– Appear in more complex applications
• Data mining
• Anti-virus software
13A-25
Structured Programming
• Programming using defined structures
• Creates easy to read code
• Programs are efficient and run fast
• Several defined structures
13A-26
Structured Programming
• Sequence structure
– Describes the flow of the program
– Typically executed in order
– Branching statements allow multiple flows
13A-27
Structured Programming
• Selection statement
– Also called conditional statement
– Performs a true or false test
– Determines which code to execute next
13A-28
Structured Programming
• Repetition statements
– Also called looping structures
– Repeats a section of code
• Until an exit condition is reached
13A-29
Object Oriented Programming
• Also known as OOP
• Enhances structured programming
• Intuitive method of programming
13A-30
Object Oriented Programming
• Code reuse
– Code used in many projects
– Speeds up program development
– Simplifies program development
13A-31
Object Oriented Programming
• Develops objects
– All real world items are objects
– OOP develops code versions
– Contains data about the item
– Contains functionality
– Object encapsulates both into one package
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
McGraw-Hill Technology Education
Chapter 13A
End of Chapter

More Related Content

Similar to Introduction to Creating Computer Programs.ppt

Week 5
Week 5Week 5
Week 5A VD
 
Week 5
Week 5Week 5
Week 5A VD
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareRai University
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Big data components - Introduction to Flume, Pig and Sqoop
Big data components - Introduction to Flume, Pig and SqoopBig data components - Introduction to Flume, Pig and Sqoop
Big data components - Introduction to Flume, Pig and SqoopJeyamariappan Guru
 
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Rogue Wave Software
 
Unit 2 computer software
Unit 2 computer softwareUnit 2 computer software
Unit 2 computer softwareHardik Patel
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design IntroductionKuppusamy P
 
C++ Training - Lecture 01
C++ Training - Lecture 01C++ Training - Lecture 01
C++ Training - Lecture 01Babak Farhang
 
ProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdfProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdflailoesakhan
 
Uc14 chap05
Uc14 chap05Uc14 chap05
Uc14 chap05ayahye
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpretersRAJU KATHI
 

Similar to Introduction to Creating Computer Programs.ppt (20)

Week 5
Week 5Week 5
Week 5
 
Week 5
Week 5Week 5
Week 5
 
Unit 4
Unit  4Unit  4
Unit 4
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer software
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Big data components - Introduction to Flume, Pig and Sqoop
Big data components - Introduction to Flume, Pig and SqoopBig data components - Introduction to Flume, Pig and Sqoop
Big data components - Introduction to Flume, Pig and Sqoop
 
Chap1
Chap1Chap1
Chap1
 
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
 
Unit 2 computer software
Unit 2 computer softwareUnit 2 computer software
Unit 2 computer software
 
lec 1.pptx
lec 1.pptxlec 1.pptx
lec 1.pptx
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design Introduction
 
C++ Training - Lecture 01
C++ Training - Lecture 01C++ Training - Lecture 01
C++ Training - Lecture 01
 
ProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdfProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdf
 
Computer Software
Computer SoftwareComputer Software
Computer Software
 
Uc14 chap05
Uc14 chap05Uc14 chap05
Uc14 chap05
 
Uc14 chap05
Uc14 chap05Uc14 chap05
Uc14 chap05
 
Lecture17.ppt
Lecture17.pptLecture17.ppt
Lecture17.ppt
 
Lecture17 (1).ppt
Lecture17 (1).pptLecture17 (1).ppt
Lecture17 (1).ppt
 
Lecture17.ppt
Lecture17.pptLecture17.ppt
Lecture17.ppt
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
 

More from Abbas Hyder , Assistant Professor

More from Abbas Hyder , Assistant Professor (20)

Earthquake.ppt
Earthquake.pptEarthquake.ppt
Earthquake.ppt
 
Rotation and Revolution of Earth.ppt
Rotation and Revolution of Earth.pptRotation and Revolution of Earth.ppt
Rotation and Revolution of Earth.ppt
 
Solar System & Quiz.ppt
Solar System & Quiz.pptSolar System & Quiz.ppt
Solar System & Quiz.ppt
 
Introduction to Online Business.ppt
Introduction to Online Business.pptIntroduction to Online Business.ppt
Introduction to Online Business.ppt
 
Introduction to Modern CPUS.ppt
Introduction to Modern CPUS.pptIntroduction to Modern CPUS.ppt
Introduction to Modern CPUS.ppt
 
Introduction to Keyboard & Mouse.ppt
Introduction to Keyboard & Mouse.pptIntroduction to Keyboard & Mouse.ppt
Introduction to Keyboard & Mouse.ppt
 
Introduction to Internet.ppt
Introduction to Internet.pptIntroduction to Internet.ppt
Introduction to Internet.ppt
 
Introduction to Internet Services.ppt
Introduction to Internet Services.pptIntroduction to Internet Services.ppt
Introduction to Internet Services.ppt
 
Introduction to Graphics & Multimedia.ppt
Introduction to Graphics & Multimedia.pptIntroduction to Graphics & Multimedia.ppt
Introduction to Graphics & Multimedia.ppt
 
Climate Change.ppt
Climate Change.pptClimate Change.ppt
Climate Change.ppt
 
Introduction to Database Managemant System.ppt
Introduction to Database Managemant System.pptIntroduction to Database Managemant System.ppt
Introduction to Database Managemant System.ppt
 
Introduction to Data Communicatins.ppt
Introduction to Data Communicatins.pptIntroduction to Data Communicatins.ppt
Introduction to Data Communicatins.ppt
 
Introduction to Building Information System.ppt
Introduction to Building Information System.pptIntroduction to Building Information System.ppt
Introduction to Building Information System.ppt
 
Inputting Data in Various ways.ppt
Inputting Data in Various ways.pptInputting Data in Various ways.ppt
Inputting Data in Various ways.ppt
 
Improving Drive Performance.ppt
Improving Drive Performance.pptImproving Drive Performance.ppt
Improving Drive Performance.ppt
 
Geography of Pakistan.pptx
Geography of Pakistan.pptxGeography of Pakistan.pptx
Geography of Pakistan.pptx
 
Types of Maps.ppt
Types of Maps.pptTypes of Maps.ppt
Types of Maps.ppt
 
Map Reading Skills.pptx
Map Reading Skills.pptxMap Reading Skills.pptx
Map Reading Skills.pptx
 
Climate Change with Quiz.pptx
Climate Change with Quiz.pptxClimate Change with Quiz.pptx
Climate Change with Quiz.pptx
 
Regional Geogaphy short notes .docx
Regional Geogaphy short notes .docxRegional Geogaphy short notes .docx
Regional Geogaphy short notes .docx
 

Recently uploaded

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Recently uploaded (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Introduction to Creating Computer Programs.ppt

  • 1. Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved.
  • 2. Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 13A Creating Computer Programs
  • 3. 13A-3 What Is a Computer Program? • Computer programs – Also called software – Are a list of instructions – Instructions are called code – CPU performs the instructions – Three types • Operating system • Utility • Application
  • 4. 13A-4 Software Is Stored In Many Files • Executable files – Contain the instructions for the CPU – Have extensions of .exe, or .com
  • 5. 13A-5 Software Is Stored In Many Files • Dynamic link libraries – Partial executable file – Used to support executable files – Have .dll extensions
  • 6. 13A-6 Software Is Stored In Many Files • Initialization files – Contain configuration settings for software – Have a .ini extension – Modern programs use the registry
  • 7. 13A-7 Software Is Stored In Many Files • Help files – Contain information about the software – Information is indexed and searchable – Provides an online manual – Have a .chm or .hlp extension
  • 8. 13A-8 Software Is Stored In Many Files • Batch files – Used to automate tasks – Hold a series of OS commands – Have a .bat extension
  • 9. 13A-9 Hardware/Software Interaction • Program execution – Software executes at the CPU level – Code to play a sound • Code generates an interrupt • CPU tells the sound card to play • Sound card plays the file – Programmer creates the code
  • 10. 13A-10 Hardware/Software Interaction • Code – Statements written in a programming language – Writing code can be tedious • Code must be perfect • Order of steps must be exact – Writing code is quite exciting • Problems are solved • New ideas are formed
  • 12. 13A-12 Hardware/Software Interaction • Machine code – Recall that computers think in binary – Code is translated into machine code • CPU executes the machine code – CPUs have a unique machine code
  • 13. 13A-13 Hardware/Software Interaction • Programming languages – Simplifies the writing of code • English is used to describe the binary – Original code is called source code – Several hundred languages exist
  • 14. 13A-14 Hardware/Software Interaction • Compilers and interpreters – Converts source code into binary • Allows code to execute – Checks source code for correctness
  • 15. 13A-15 Hardware/Software Interaction • Compiler – Creates an executable file • Contents are called object code – Executable can run on its own – Each language has its own compiler – C++ and Java are compiled languages
  • 16. 13A-16 Hardware/Software Interaction • Interpreter – Runs program one line at a time – More flexible than compilers – Slower than compilers – Always needed to execute program – Visual Basic and Perl are interpreted
  • 17. 13A-17 Planning a Computer Program • Plans – The steps to solve a problem – Describe the expected results – Programming without a plan is difficult
  • 18. 13A-18 Planning Tools • Pseudo code – Natural language statements that resemble code – Describes what must be done – Can be written by non programmers – Programmers develop unique versions
  • 19. 13A-19 Planning Tools • Input-processing-output (IPO) charts – Determines what is needed – Input column • Data inputted by the user – Processing column • Pseudo code describing the problem solution – Output column • Desired output from the program
  • 21. 13A-21 How Programs Solve Problems • Program control flow – Order program statements are executed – Typically executed in order – Constructs can change the flow • Decision statements • Loops
  • 22. 13A-22 How Programs Solve Problems • Algorithm – Set of steps – Always leads to a solution – Steps are always the same – Flowcharts can describe algorithms • Structured tool for drawing algorithms – Algorithms appear in all programs
  • 24. 13A-24 How Programs Solve Problems • Heuristic – Set of steps – Solution is usually found – Solution may not be optimal – Used when algorithms fail • Algorithm is nonexistent or too complex – Appear in more complex applications • Data mining • Anti-virus software
  • 25. 13A-25 Structured Programming • Programming using defined structures • Creates easy to read code • Programs are efficient and run fast • Several defined structures
  • 26. 13A-26 Structured Programming • Sequence structure – Describes the flow of the program – Typically executed in order – Branching statements allow multiple flows
  • 27. 13A-27 Structured Programming • Selection statement – Also called conditional statement – Performs a true or false test – Determines which code to execute next
  • 28. 13A-28 Structured Programming • Repetition statements – Also called looping structures – Repeats a section of code • Until an exit condition is reached
  • 29. 13A-29 Object Oriented Programming • Also known as OOP • Enhances structured programming • Intuitive method of programming
  • 30. 13A-30 Object Oriented Programming • Code reuse – Code used in many projects – Speeds up program development – Simplifies program development
  • 31. 13A-31 Object Oriented Programming • Develops objects – All real world items are objects – OOP develops code versions – Contains data about the item – Contains functionality – Object encapsulates both into one package
  • 32. Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 13A End of Chapter