Introduction to Computer Programming
Introduction
Overview of Computers and
Programming Languages
C++ Programming: From Problem Analysis to Program Design
Overview of Computers and Programming
Languages
Chapter Contents
• Computer History
• Elements of a Computer System
– Hardware
– Software
• Language of a Computer
• Evolution of Programming Languages
• High Level Languages
• Analysis‐Coding‐Execution
• Object Oriented Programming
Computer History
• 1950's
– Large devices, accessible to few people
• 1960's
– Commercial usage emerges
– Operated by experts
• 1970's
– Computers cheaper, smaller
• 1990's
– Computers fast, small, inexpensive
– Owned and used by many people
Elements of a Computer System
Hardware CPU
The "brain" of
the computer
Main Memory
Data and
instructions stored
to, fetched from
• Keyboard
• Disk drive
• Scanner
• Mouse
• Screen
• Printer
• Plotter
• Hard drive
• Zip‐Disk
• CD‐Rom
• Tape Backup
Elements of a Computer System
Software
• Systems programs
– Control the computer
– Includes Operating System (ex: windows, Apple Mac,
Chrome OS etc..)
• Applications programs
– Word processors (wordpad, MS Word)
– Compilers (MSVS, C++ Builder)
– Spreadsheets (MS Excel)
– Data Bases (MS Access)
The Language of a Computer
• Uses digital signals
– all 0's and 1's (binary)
– bits (BInary digiTs)
• Data and commands stored in binary
– 8 bits in a byte
– ASCII character stored in a byte
– Integers stored in 2 or 4 bytes
ASCII Code
American Standard Code for Information
Interchange
Evolution of Programming Languages
• Early computers programmed in machine languages
– All binary numbers
• Assembly language used mnemonic codes
– Codes translated
into machine
language by a
program called
the "assembler"
Evolution of Programming Languages
• High level languages read like combination of English
and algebra
– Translated into machine language by a program called a
compiler
Analysis‐Coding‐Execution
Problem solving process
1. Analyze problem, design solution algorithm
2. Implement algorithm in a programming language,
verify
3. Maintain program, adapting it to changes in
problem requirements
Analysis‐Coding‐Execution
• Algorithm : A step‐by‐step problem‐solving process
in which a solution is arrived at in a finite amount of
time
– Steps must be simple, unambiguous
– Steps must be performed in specified order
– Steps must solve the problem
Analysis‐Coding‐Execution
Analysis and
algorithm design
done apart from
any specific
programming
language
Processing of the
high‐level language
programming
language
Processing a High‐Level Language Program
1. Source program created with an editor
2. Source code translated into machine language by
compiler
‐ Results in a “.obj” file (object code)
3. Linker combines common library routines with
object code
‐ Results in a “.exe” file (executable code)
4. Loader brings executable code into memory and it
is run
Processing a High‐Level Language Program
Structured Programming
• Thoroughly understand the problem
• Determine
– the output desired
– the required input
– processing that will occur
• Divide the problem into sub‐problems

Overview of computers and programming

  • 1.
    Introduction to ComputerProgramming Introduction Overview of Computers and Programming Languages C++ Programming: From Problem Analysis to Program Design
  • 2.
    Overview of Computersand Programming Languages
  • 3.
    Chapter Contents • ComputerHistory • Elements of a Computer System – Hardware – Software • Language of a Computer • Evolution of Programming Languages • High Level Languages • Analysis‐Coding‐Execution • Object Oriented Programming
  • 4.
    Computer History • 1950's –Large devices, accessible to few people • 1960's – Commercial usage emerges – Operated by experts • 1970's – Computers cheaper, smaller • 1990's – Computers fast, small, inexpensive – Owned and used by many people
  • 5.
    Elements of aComputer System Hardware CPU The "brain" of the computer Main Memory Data and instructions stored to, fetched from • Keyboard • Disk drive • Scanner • Mouse • Screen • Printer • Plotter • Hard drive • Zip‐Disk • CD‐Rom • Tape Backup
  • 6.
    Elements of aComputer System Software • Systems programs – Control the computer – Includes Operating System (ex: windows, Apple Mac, Chrome OS etc..) • Applications programs – Word processors (wordpad, MS Word) – Compilers (MSVS, C++ Builder) – Spreadsheets (MS Excel) – Data Bases (MS Access)
  • 7.
    The Language ofa Computer • Uses digital signals – all 0's and 1's (binary) – bits (BInary digiTs) • Data and commands stored in binary – 8 bits in a byte – ASCII character stored in a byte – Integers stored in 2 or 4 bytes
  • 8.
    ASCII Code American StandardCode for Information Interchange
  • 9.
    Evolution of ProgrammingLanguages • Early computers programmed in machine languages – All binary numbers • Assembly language used mnemonic codes – Codes translated into machine language by a program called the "assembler"
  • 10.
    Evolution of ProgrammingLanguages • High level languages read like combination of English and algebra – Translated into machine language by a program called a compiler
  • 11.
    Analysis‐Coding‐Execution Problem solving process 1.Analyze problem, design solution algorithm 2. Implement algorithm in a programming language, verify 3. Maintain program, adapting it to changes in problem requirements
  • 12.
    Analysis‐Coding‐Execution • Algorithm :A step‐by‐step problem‐solving process in which a solution is arrived at in a finite amount of time – Steps must be simple, unambiguous – Steps must be performed in specified order – Steps must solve the problem
  • 13.
    Analysis‐Coding‐Execution Analysis and algorithm design doneapart from any specific programming language Processing of the high‐level language programming language
  • 14.
    Processing a High‐LevelLanguage Program 1. Source program created with an editor 2. Source code translated into machine language by compiler ‐ Results in a “.obj” file (object code) 3. Linker combines common library routines with object code ‐ Results in a “.exe” file (executable code) 4. Loader brings executable code into memory and it is run
  • 15.
    Processing a High‐LevelLanguage Program
  • 16.
    Structured Programming • Thoroughlyunderstand the problem • Determine – the output desired – the required input – processing that will occur • Divide the problem into sub‐problems