Imperative Programming: Introduction To Computers and Programming
Imperative Programming: Introduction To Computers and Programming
Imperative Programming: Introduction To Computers and Programming
Imperative Programming
Lecture 1.2
(Week 1, Lecture 2)
Chapter 1:
Introduction to Computers
and Programming
Tuesday 7 Feb & Wednesday 8 Feb2016
Group 5: 14:30 – 15:20 (EMS 2-150), Tues
Group 4: 12:30 – 13:20 (Centenary 3), Wed
Admin (questions that students have asked)
1) Where is the Informatorium?
IT building, street level. The entrance is next to the main
entrance to the IT building.
3
Course objectives & outcomes
(1) COS132 covers the activities of constructing a
program for solving a given problem:
Main Hardware
Component categories:
1. Central Processing
Unit (CPU)
4. Input Devices
CPU
Organization
Main Memory
• It is volatile.
– Main memory is erased
when program terminates
or computer is turned off
• Organized as follows:
– bit: smallest piece of memory.
Has values 0 (off, false) or 1
Mother board
(on, true)
• What is missing?
Input Devices
• Devices that send information to the computer from
outside
• Many devices can provide input:
– Keyboard, mouse, scanner,
digital camera, microphone
– Disk drives, CD drives,
and DVD drives
– What is missing?
Software-Programs That Run on a
Computer
• Categories of software:
System software:
– programs that manage the computer hardware and the
programs that run on them.
– Application software:
– programs that provide services to the user.
– Examples : word processing, games, programs to solve
specific problems
Programs and Programming Languages
• A program is a set of instructions that the computer
follows to perform a task
• We start with an algorithm, which is a set of well-defined
steps.
1011010000000101
Types of languages:
C++
BASIC Ruby
FORTRAN
Java
Visual Basic
COBOL
C#
JavaScript
C Python
From a High-Level Program to an
Executable File
a) Create file containing the
program with a text editor.
b) Run preprocessor to convert
source file directives to source
code program statements.
c) Run compiler to convert source
program into machine
instructions.
d) Run linker to connect
hardware-specific code to
machine instructions,
producing an executable file.
• Steps b–d are often performed
by a single command or button
click.
• Errors detected at any step will
prevent execution of following
steps.
Integrated Development Environments
(IDEs)
• An integrated development environment, or IDE,
combine all the tools needed to write, compile, and
debug a program into a single software application.