Computer Programming I Unit I Lecture Notes
Computer Programming I Unit I Lecture Notes
Unit I
Introduction to Programming
UNIT I: INTRODUCTION TO PROGRAMMING
Content:
• Machine, Assembly and High-Level Language
• The programmer’s job
• Control Structures
What is Programming Language?
❑Machine Language
❑ Low-level Language
❑ High-level Language
MACHINE LANGUAGE
Machine Language
Program
MACHINE LANGUAGE
ASCII (American Standard Code for
Information Interchange)
Putting it together:
H - 01001000
i - 01101001
Hi - 01001000 01101001
Categories of Programming Language?
❑Machine Language
❑ Low-level Language
❑ High-level Language
LOW-LEVEL LANGUAGE
LOW-LEVEL LANGUAGE
❑Machine Language
❑ Low-level Language
❑ High-level Language
HIGH-LEVEL LANGUAGE
Machine Language
Program Central
The compiler is Processing Unit
used to translate (CPU)
the high-level
language program
to a machine
language program.
MIDDLE-LEVEL LANGUAGE
❑Middle-Level Languages:
❑Languages that bridge the gap between low-
level control and high-level abstraction.
They offer more user-friendliness than
assembly but still allow for direct memory
manipulation and hardware interaction.
❑Example: C, C++ (often considered middle-
level due to pointer manipulation and direct
memory access, despite having high-level
features).
C++ AS MIDDLE-LEVEL LANGUAGE
❑Middle-Level Languages:
❑C++ is a powerful, high-level, general-
purpose programming language that
provides extensive abstraction and modern
programming paradigms. However, it also
retains the ability to perform low-level
memory manipulation and hardware
interaction, making it incredibly versatile
and efficient for a wide range of
applications.
C++ AS MIDDLE-LEVEL LANGUAGE
❑Middle-Level Languages:
❑This blend of high-level features and
low-level control is what sometimes
leads to it being described as a
"middle-level" language.
Programmer’s Job
PROGRAMMER’S JOB
❑ Sequence Structure
❑ Selection Structure
❑ Repetition Structure
SEQUENCE STRUCTURE
❑ Sequence Structure
❑ Selection Structure
❑ Repetition Structure
SELECTION STRUCTURE
❑ Sequence Structure
❑ Selection Structure
❑ Repetition Structure
REPETITION STRUCTURE