Computer Programming - Lecture 1

Dr. Md. Shohel Sayeed
Dr. Md. Shohel SayeedAssociate Professor um Faculty of Information Science & Technology, Multimedia University
TCP1231 Computer Programming I

                    FIST
             Multimedia University




  Computer Programming I             1
Academicians
Lecturers
  Dr. Md Shohel Sayeed
            ITB R 2003
            Ext 3296
  Dr. Cheah Wooi Ping       For consultation hour,
            ITB R 2002       please refer to the
            Ext 3315/4113      FIST’s website




  Computer Programming I             2
Notes
Attendance… 80% no compromise
Read slides… before come to the class
Plagiarism… I know all your code
Exercise… you have to do a LOT
Problem… come to see me




  Computer Programming I       3
Objectives
To help students achieve a reasonable level
 of competence in both problem solving and
 writing computer programs using C++
 programming language.
To encourage students to appreciate the
 value of adopting good programming style
 and taking a structured modular approach
 to the design of programs.


  Computer Programming I        4
Skills expected to be acquired
Problem solving and software development
  using C++ language
The use of a range of software tools and
  packages (compiler, development
  environment, debugger, word processor)
Practical skills in an operating system
  environment (Windows) and the use of the
  internet and online resources


  Computer Programming I        5
Course Outline
Lec1 – Introduction to computing and programming
Lec2 – Algorithms and Problem Solving
Lec3 – C++ Basics (Part I)
Lec4 – C++ Basics (Part II)
Lec5 – More Flow of Control
Lec6 – Procedural Abstraction (function part 1)
Lec7 – Modular Design and functions (functions part 2)
      + Namespaces and separate compilation
Lec8 – Arrays
Lec9 – Introduction to Classes and Structures
Lec10 – Array & Strings & Vectors
Lec11 – Pointers
Lec12 – Pointers and Dynamic Arrays
Lec12 – I/O Streams and Files

    Computer Programming I                               6
Coursework and Examinations
Final Exam (40%)
Coursework (60%)
  20% Lab Test (20%)
  20% Assignments (5%+15%)
          There will be 2 interviews for Assignment 1 & 2 .
  20% Mid-Term Test (20%)




  Computer Programming I                  7
Resources
 Textbook
   Walter Savitch, 2012, Problem Solving with C++
    (Eighth Edition), Addison Wesley
 Reference
    Frank L. Friedman, “Problem Solving, Abstraction,
     and Design Using C++”, Sixth Edition, Pearson
    Deitel, C++ How to Program(Fifth Edition), Pearson
    Horstmann, Budd, “Big C++”, 2nd Edition, Wiley
    Tony Graddis, Barret Krupnow, Starting Out with C+
     +, Addison Wesley


   Computer Programming I                8
Integrated Development Environment
               (IDE)




  Computer Programming I   9
Lecture 1
          Introduction
                to
     Computers & Programming




Computer Programming I      10
Overview
   Computer systems
   Programming languages
   Compiler
   Linker




    Computer Programming I     11
Computer System
 A computer program is…
   A set of instructions for a computer to follow

 Computer software is …
   The collection of programs used by a computer
     • Includes:
           » Editors
           » Translators
           » System Managers



  Computer Programming I               12
Hardware
 Three main classes of computers

   PCs (Personal Computer)
     • Relatively small used by one person at a time

   Workstation
     • Larger and more powerful than a PC

   Mainframe
     • Still larger
     • Requires support staff
     • Shared by multiple users

  Computer Programming I                          13
Computer Organization




Computer Programming I   14
Computer Organization
   Five main components
    1) Input devices
       – Allows communication to the computer
    1) Output devices
       – Allows communication to the user
    1) Processor (CPU)
    2) Main memory
       – Memory locations containing the running program
    1) Secondary memory
       – Permanent record of data often on a disk



Computer Programming I                        15
Computer Memory
 Main Memory
   Long list of memory locations
     • Each contains zeros and ones
     • Can change during program execution
   Binary Digit or Bit
     • A digit that can only be zero or one
   Byte
     • Each memory location has eight bits
   Address
     • Number that identifies a memory location
  Computer Programming I                      16
Secondary Memory
 Main memory stores instructions and
  data while a program is running.
 Secondary memory
   Stores instructions and data between sessions
   A file stores data or instructions in
    secondary memory




  Computer Programming I            17
Memory Access
 Random Access
   Usually called RAM
     • Computer can directly access any memory location

 Sequential Access
   Data is generally found by searching through
    other items first
     • More common in secondary memory




  Computer Programming I                 18
The Processor
 Typically called the CPU
   Central Processing Unit
   Follows program instructions
   Typical capabilities of CPU include:

        add
        subtract
        multiply
        divide
        move data from location to location

  Computer Programming I              19
Computer Software
 The operating system
     Allows us to communicate with the computer
     Is a program
     Allocates the computer’s resources
     Responds to user requests to run other
      programs

 Common operating systems include…
   UNIX    Linux DOS
    Windows Macintosh VMS
  Computer Programming I              20
High-level Languages
 Common programming languages include …

  C C++ Java       Pascal Visual Basic    FORTRAN
   COBOL Lisp      Scheme Ada

 These high – level languages
   Resemble human languages
   Are designed to be easy to read and write
   Use more complicated instructions than
     the CPU can follow
   Must be translated to zeros and ones for the CPU
    to execute a program

  Computer Programming I                  21
Low-level Languages
 An assembly language command such as

               ADD X Y Z

  might mean add the values found at x and y
  in memory, and store the result in location z.

 Assembly language must be translated to
  machine language (zeros and ones)
      0110 1001 1010 1011
 The CPU can follow machine language

  Computer Programming I               22
Programming Languages
 Various programming languages enable
  people to tell computers what to do
 Foundation for developing applications




 Computer Programming I        23
Programming Languages
 Machine Language (first generation)
    The computer’s ‘native language’
    Composed of binary digits (0s, 1s)
       Eg. 0110   1001 1010 1011
    The only language that computers understand
 Assembly Language (second generation)
    One-to-one correspondence to machine language
    Somewhat more user-friendly than machine
     language (mnemonic rather than binary digits)
       Eg. ADD X Y Z
    Assembler – program that translates an assembly
     language program into machine language

  Computer Programming I                  24
Programming Languages
 Procedural Languages (third generation)
    One instruction translates into many machine
     language instructions
    Programs describe the computer’s processing
     step-by-step
    Closer to natural language; uses common words
     rather than abbreviated mnemonics
    Examples: C, C++, Java, Fortran, QuickBasic
    Compiler - translates the entire program at once
    Interpreter - translates and executes one source
     program statement at a time


 Computer Programming I                   25
Programming Languages
 Nonprocedural Languages (fourth generation)
    Allows the user to specify the desired result without
     having to specify the detailed procedures needed
     for achieving the result
   Example: – database query language - SQL
   Can be used by non technical users
 Natural Language Programming Languages
  (fifth generation (intelligent) languages)
    Translates natural languages into a structured,
     machine-readable form
    Are extremely complex and experimental


 Computer Programming I                        26
Current Programming Languages
 Object-Oriented Programming Languages (OOP)
   based on objects – packaging data and the
    instructions about what to do with that data together
   Examples: Java, C++

 Visual Programming Languages
   Used within a graphical environment
   Examples : Visual Basic and Visual C++
   Popular to non technical users.




 Computer Programming I                    27
Current Programming Languages
 Hypertext Markup Language (HTML)
   standard language used in World Wide Web
   contains text, images, and other types of
    information such as data files, audio, video, and
    executable computer programs
 Extensible Markup Language (XML)
   Improved on web document functionality
 Virtual Reality Modeling Language (VRML)
   a file format for describing three-dimensional
    (3D) interactive worlds and objects
   can be used with the World Wide Web
   Computer Programming I               28
Compilers
 Translate high-level language to
  machine language

   Source code
     • The original program in a high level language
   Object code
     • The translated version in machine language




  Computer Programming I                   29
Linkers
 Some programs we use are already compiled
   Their object code is available for us to use
   For example: Input and output routines

 A Linker combines
   The object code for the programs we write
                      and
   The object code for the pre-compiled routines
                      into
   The machine language program the CPU can run


  Computer Programming I                     30
1 von 30

Recomendados

Lecture 1 introduction to computing von
Lecture 1 introduction to computingLecture 1 introduction to computing
Lecture 1 introduction to computingKabul Education University
17.9K views23 Folien
Computer programming concepts von
Computer programming conceptsComputer programming concepts
Computer programming conceptsJasper John Cinatad
3.1K views9 Folien
Chapter 1 - An Introduction to Programming von
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
7.1K views26 Folien
Intro To Programming Concepts von
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
10.1K views27 Folien
Computer Programming von
Computer ProgrammingComputer Programming
Computer ProgrammingSyed Zaid Irshad
3K views16 Folien
Introduction to computer programming von
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
16.3K views18 Folien

Más contenido relacionado

Was ist angesagt?

History of programming von
History of programmingHistory of programming
History of programmingSharwin Calimlim
20.6K views32 Folien
Computer programming von
Computer programmingComputer programming
Computer programmingVincent Valenzuela
5.5K views17 Folien
Basic programming concepts von
Basic programming conceptsBasic programming concepts
Basic programming conceptssalmankhan570
10.8K views48 Folien
Computer Programming von
Computer Programming Computer Programming
Computer Programming Newreborn Incarnation
13.9K views24 Folien
Basic Computer Operation von
Basic Computer OperationBasic Computer Operation
Basic Computer OperationUniversidad De Zamboanga
16.5K views45 Folien
Programming Fundamentals von
Programming FundamentalsProgramming Fundamentals
Programming FundamentalsTrivuz ত্রিভুজ
24.8K views42 Folien

Was ist angesagt?(20)

Basic programming concepts von salmankhan570
Basic programming conceptsBasic programming concepts
Basic programming concepts
salmankhan57010.8K views
Algorithm and flowchart von Sachin Goyani
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
Sachin Goyani7.1K views
Programming Fundamental Presentation von fazli khaliq
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq2.1K views
Computer Software And its types von Mirza Kaleem
Computer Software And its typesComputer Software And its types
Computer Software And its types
Mirza Kaleem1.1K views
Lect 1. introduction to programming languages von Varun Garg
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg235.3K views
Evolution of computer von Ankit Yadav
Evolution of computerEvolution of computer
Evolution of computer
Ankit Yadav129.6K views
Introduction Programming Languages von Manish Kharotia
Introduction Programming LanguagesIntroduction Programming Languages
Introduction Programming Languages
Manish Kharotia666 views

Destacado

Introduction to computer programming von
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNoel Malle
6.4K views4 Folien
Consumers' welfare and protection von
Consumers' welfare and protectionConsumers' welfare and protection
Consumers' welfare and protectionJasmine Shania Tasker
72.6K views21 Folien
Consumer Product Safety Commission3 von
Consumer Product Safety Commission3Consumer Product Safety Commission3
Consumer Product Safety Commission3ahmad bassiouny
1.4K views22 Folien
Excel Lesson 1: Excel Basics von
Excel Lesson 1: Excel BasicsExcel Lesson 1: Excel Basics
Excel Lesson 1: Excel BasicsNovus Business and IT Training Program
6.7K views17 Folien
Consumerism von
ConsumerismConsumerism
ConsumerismMusthak Manrah
65.5K views16 Folien
Computer programmer job information von
Computer programmer job informationComputer programmer job information
Computer programmer job informationChrisinCT
3.3K views12 Folien

Similar a Computer Programming - Lecture 1

Programming_Fundamentals_Chapter_1_INTRO.pdf von
Programming_Fundamentals_Chapter_1_INTRO.pdfProgramming_Fundamentals_Chapter_1_INTRO.pdf
Programming_Fundamentals_Chapter_1_INTRO.pdfBernardVelasco1
8 views31 Folien
C 1 von
C 1C 1
C 1guest8be6bb5
336 views32 Folien
An overview of computers and programming languages von
An overview of computers and programming languages An overview of computers and programming languages
An overview of computers and programming languages Ahmad Idrees
2.1K views36 Folien
C++ Training - Lecture 01 von
C++ Training - Lecture 01C++ Training - Lecture 01
C++ Training - Lecture 01Babak Farhang
216 views36 Folien
Btech i pic u-1 introduction to c language von
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageRai University
547 views33 Folien
Diploma ii cfpc u-1 introduction to c language von
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c languageRai University
953 views33 Folien

Similar a Computer Programming - Lecture 1(20)

Programming_Fundamentals_Chapter_1_INTRO.pdf von BernardVelasco1
Programming_Fundamentals_Chapter_1_INTRO.pdfProgramming_Fundamentals_Chapter_1_INTRO.pdf
Programming_Fundamentals_Chapter_1_INTRO.pdf
BernardVelasco18 views
An overview of computers and programming languages von Ahmad Idrees
An overview of computers and programming languages An overview of computers and programming languages
An overview of computers and programming languages
Ahmad Idrees2.1K views
Btech i pic u-1 introduction to c language von Rai University
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
Rai University547 views
Diploma ii cfpc u-1 introduction to c language von Rai University
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
Rai University953 views
Mca i pic u-1 introduction to c language von Rai University
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
Rai University499 views
introduction to c language von Rai University
 introduction to c language introduction to c language
introduction to c language
Rai University1.6K views
Bsc cs i pic u-1 introduction to c language von Rai University
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
Rai University1.6K views
Csphtp1 01 von HUST
Csphtp1 01Csphtp1 01
Csphtp1 01
HUST362 views
Programming Fundamentals and Programming Languages Concepts von imtiazalijoono
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Concepts
imtiazalijoono178 views
Computer Software and It's Development von Rabin BK
Computer Software and It's DevelopmentComputer Software and It's Development
Computer Software and It's Development
Rabin BK110 views
Introduction To Computer and Java von PRN USM
Introduction To Computer and JavaIntroduction To Computer and Java
Introduction To Computer and Java
PRN USM948 views

Más de Dr. Md. Shohel Sayeed

Lecture 12: Classes and Files von
Lecture 12: Classes and FilesLecture 12: Classes and Files
Lecture 12: Classes and FilesDr. Md. Shohel Sayeed
30.1K views48 Folien
Computer Programming- Lecture 11 von
Computer Programming- Lecture 11Computer Programming- Lecture 11
Computer Programming- Lecture 11Dr. Md. Shohel Sayeed
32.4K views26 Folien
Computer Programming- Lecture 10 von
Computer Programming- Lecture 10Computer Programming- Lecture 10
Computer Programming- Lecture 10Dr. Md. Shohel Sayeed
32.4K views28 Folien
Computer Programming- Lecture 9 von
Computer Programming- Lecture 9Computer Programming- Lecture 9
Computer Programming- Lecture 9Dr. Md. Shohel Sayeed
31.9K views31 Folien
Computer Programming- Lecture 8 von
Computer Programming- Lecture 8Computer Programming- Lecture 8
Computer Programming- Lecture 8Dr. Md. Shohel Sayeed
31.8K views18 Folien
Computer Programming- Lecture 7 von
Computer Programming- Lecture 7Computer Programming- Lecture 7
Computer Programming- Lecture 7Dr. Md. Shohel Sayeed
32.1K views16 Folien

Último

Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... von
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Ms. Pooja Bhandare
194 views45 Folien
MercerJesse3.0.pdf von
MercerJesse3.0.pdfMercerJesse3.0.pdf
MercerJesse3.0.pdfjessemercerail
92 views6 Folien
REFERENCING, CITATION.pptx von
REFERENCING, CITATION.pptxREFERENCING, CITATION.pptx
REFERENCING, CITATION.pptxabhisrivastava11
39 views26 Folien
MIXING OF PHARMACEUTICALS.pptx von
MIXING OF PHARMACEUTICALS.pptxMIXING OF PHARMACEUTICALS.pptx
MIXING OF PHARMACEUTICALS.pptxAnupkumar Sharma
117 views35 Folien
unidad 3.pdf von
unidad 3.pdfunidad 3.pdf
unidad 3.pdfMarcosRodriguezUcedo
129 views38 Folien
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a Choice von
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a ChoiceCreative Restart 2023: Atila Martins - Craft: A Necessity, Not a Choice
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a ChoiceTaste
41 views50 Folien

Último(20)

Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... von Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Ms. Pooja Bhandare194 views
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a Choice von Taste
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a ChoiceCreative Restart 2023: Atila Martins - Craft: A Necessity, Not a Choice
Creative Restart 2023: Atila Martins - Craft: A Necessity, Not a Choice
Taste41 views
Create a Structure in VBNet.pptx von Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P82 views
The Accursed House by Émile Gaboriau von DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta246 views
EILO EXCURSION PROGRAMME 2023 von info33492
EILO EXCURSION PROGRAMME 2023EILO EXCURSION PROGRAMME 2023
EILO EXCURSION PROGRAMME 2023
info33492181 views
Guess Papers ADC 1, Karachi University von Khalid Aziz
Guess Papers ADC 1, Karachi UniversityGuess Papers ADC 1, Karachi University
Guess Papers ADC 1, Karachi University
Khalid Aziz83 views
Education of marginalized and socially disadvantages segments.pptx von GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati540 views
Retail Store Scavenger Hunt.pptx von jmurphy154
Retail Store Scavenger Hunt.pptxRetail Store Scavenger Hunt.pptx
Retail Store Scavenger Hunt.pptx
jmurphy15452 views
JQUERY.pdf von ArthyR3
JQUERY.pdfJQUERY.pdf
JQUERY.pdf
ArthyR3103 views
SURGICAL MANAGEMENT OF CERVICAL CANCER DR. NN CHAVAN 28102023.pptx von Niranjan Chavan
SURGICAL MANAGEMENT OF CERVICAL CANCER DR. NN CHAVAN 28102023.pptxSURGICAL MANAGEMENT OF CERVICAL CANCER DR. NN CHAVAN 28102023.pptx
SURGICAL MANAGEMENT OF CERVICAL CANCER DR. NN CHAVAN 28102023.pptx
Niranjan Chavan43 views

Computer Programming - Lecture 1

  • 1. TCP1231 Computer Programming I FIST Multimedia University Computer Programming I 1
  • 2. Academicians Lecturers Dr. Md Shohel Sayeed ITB R 2003 Ext 3296 Dr. Cheah Wooi Ping For consultation hour, ITB R 2002 please refer to the Ext 3315/4113 FIST’s website Computer Programming I 2
  • 3. Notes Attendance… 80% no compromise Read slides… before come to the class Plagiarism… I know all your code Exercise… you have to do a LOT Problem… come to see me Computer Programming I 3
  • 4. Objectives To help students achieve a reasonable level of competence in both problem solving and writing computer programs using C++ programming language. To encourage students to appreciate the value of adopting good programming style and taking a structured modular approach to the design of programs. Computer Programming I 4
  • 5. Skills expected to be acquired Problem solving and software development using C++ language The use of a range of software tools and packages (compiler, development environment, debugger, word processor) Practical skills in an operating system environment (Windows) and the use of the internet and online resources Computer Programming I 5
  • 6. Course Outline Lec1 – Introduction to computing and programming Lec2 – Algorithms and Problem Solving Lec3 – C++ Basics (Part I) Lec4 – C++ Basics (Part II) Lec5 – More Flow of Control Lec6 – Procedural Abstraction (function part 1) Lec7 – Modular Design and functions (functions part 2) + Namespaces and separate compilation Lec8 – Arrays Lec9 – Introduction to Classes and Structures Lec10 – Array & Strings & Vectors Lec11 – Pointers Lec12 – Pointers and Dynamic Arrays Lec12 – I/O Streams and Files Computer Programming I 6
  • 7. Coursework and Examinations Final Exam (40%) Coursework (60%) 20% Lab Test (20%) 20% Assignments (5%+15%) There will be 2 interviews for Assignment 1 & 2 . 20% Mid-Term Test (20%) Computer Programming I 7
  • 8. Resources  Textbook  Walter Savitch, 2012, Problem Solving with C++ (Eighth Edition), Addison Wesley  Reference  Frank L. Friedman, “Problem Solving, Abstraction, and Design Using C++”, Sixth Edition, Pearson  Deitel, C++ How to Program(Fifth Edition), Pearson  Horstmann, Budd, “Big C++”, 2nd Edition, Wiley  Tony Graddis, Barret Krupnow, Starting Out with C+ +, Addison Wesley Computer Programming I 8
  • 9. Integrated Development Environment (IDE) Computer Programming I 9
  • 10. Lecture 1 Introduction to Computers & Programming Computer Programming I 10
  • 11. Overview  Computer systems  Programming languages  Compiler  Linker Computer Programming I 11
  • 12. Computer System  A computer program is…  A set of instructions for a computer to follow  Computer software is …  The collection of programs used by a computer • Includes: » Editors » Translators » System Managers Computer Programming I 12
  • 13. Hardware  Three main classes of computers  PCs (Personal Computer) • Relatively small used by one person at a time  Workstation • Larger and more powerful than a PC  Mainframe • Still larger • Requires support staff • Shared by multiple users Computer Programming I 13
  • 15. Computer Organization  Five main components 1) Input devices – Allows communication to the computer 1) Output devices – Allows communication to the user 1) Processor (CPU) 2) Main memory – Memory locations containing the running program 1) Secondary memory – Permanent record of data often on a disk Computer Programming I 15
  • 16. Computer Memory  Main Memory  Long list of memory locations • Each contains zeros and ones • Can change during program execution  Binary Digit or Bit • A digit that can only be zero or one  Byte • Each memory location has eight bits  Address • Number that identifies a memory location Computer Programming I 16
  • 17. Secondary Memory  Main memory stores instructions and data while a program is running.  Secondary memory  Stores instructions and data between sessions  A file stores data or instructions in secondary memory Computer Programming I 17
  • 18. Memory Access  Random Access  Usually called RAM • Computer can directly access any memory location  Sequential Access  Data is generally found by searching through other items first • More common in secondary memory Computer Programming I 18
  • 19. The Processor  Typically called the CPU  Central Processing Unit  Follows program instructions  Typical capabilities of CPU include: add subtract multiply divide move data from location to location Computer Programming I 19
  • 20. Computer Software  The operating system  Allows us to communicate with the computer  Is a program  Allocates the computer’s resources  Responds to user requests to run other programs  Common operating systems include…  UNIX Linux DOS Windows Macintosh VMS Computer Programming I 20
  • 21. High-level Languages  Common programming languages include … C C++ Java Pascal Visual Basic FORTRAN COBOL Lisp Scheme Ada  These high – level languages  Resemble human languages  Are designed to be easy to read and write  Use more complicated instructions than the CPU can follow  Must be translated to zeros and ones for the CPU to execute a program Computer Programming I 21
  • 22. Low-level Languages  An assembly language command such as ADD X Y Z might mean add the values found at x and y in memory, and store the result in location z.  Assembly language must be translated to machine language (zeros and ones) 0110 1001 1010 1011  The CPU can follow machine language Computer Programming I 22
  • 23. Programming Languages  Various programming languages enable people to tell computers what to do  Foundation for developing applications Computer Programming I 23
  • 24. Programming Languages  Machine Language (first generation)  The computer’s ‘native language’  Composed of binary digits (0s, 1s)  Eg. 0110 1001 1010 1011  The only language that computers understand  Assembly Language (second generation)  One-to-one correspondence to machine language  Somewhat more user-friendly than machine language (mnemonic rather than binary digits)  Eg. ADD X Y Z  Assembler – program that translates an assembly language program into machine language Computer Programming I 24
  • 25. Programming Languages  Procedural Languages (third generation)  One instruction translates into many machine language instructions  Programs describe the computer’s processing step-by-step  Closer to natural language; uses common words rather than abbreviated mnemonics  Examples: C, C++, Java, Fortran, QuickBasic  Compiler - translates the entire program at once  Interpreter - translates and executes one source program statement at a time Computer Programming I 25
  • 26. Programming Languages  Nonprocedural Languages (fourth generation)  Allows the user to specify the desired result without having to specify the detailed procedures needed for achieving the result Example: – database query language - SQL Can be used by non technical users  Natural Language Programming Languages (fifth generation (intelligent) languages)  Translates natural languages into a structured, machine-readable form  Are extremely complex and experimental Computer Programming I 26
  • 27. Current Programming Languages  Object-Oriented Programming Languages (OOP)  based on objects – packaging data and the instructions about what to do with that data together  Examples: Java, C++  Visual Programming Languages  Used within a graphical environment  Examples : Visual Basic and Visual C++  Popular to non technical users. Computer Programming I 27
  • 28. Current Programming Languages  Hypertext Markup Language (HTML)  standard language used in World Wide Web  contains text, images, and other types of information such as data files, audio, video, and executable computer programs  Extensible Markup Language (XML)  Improved on web document functionality  Virtual Reality Modeling Language (VRML)  a file format for describing three-dimensional (3D) interactive worlds and objects  can be used with the World Wide Web Computer Programming I 28
  • 29. Compilers  Translate high-level language to machine language  Source code • The original program in a high level language  Object code • The translated version in machine language Computer Programming I 29
  • 30. Linkers  Some programs we use are already compiled  Their object code is available for us to use  For example: Input and output routines  A Linker combines  The object code for the programs we write and  The object code for the pre-compiled routines into  The machine language program the CPU can run Computer Programming I 30
  • 31. How are Programs Understood by the Computer?  The Language Translation Process Program written in Translator Program written in programming program machine language  Assembler language (object (source code) code)  Compiler  Interpreter Processed By CPU Computer Programming I 31
  • 32. History Note  First programmable computer  Designed by Charles Babbage  Began work in 1822  Not completed in Babbage’s life time  First programmer  Ada Augusta, Countess of Lovelace • Colleague of Babbage Computer Programming I 32