Computer Programming
Chapter-1: Introduction
Eyob S.
AAiT
April 2, 2025
Eyob S. (AAiT) Computer Programming April 2, 2025 1 / 50
Table of Contents
1 Course Introduction
2 Computer Programming, Computer Science, Computation
3 History of computing and programming
4 Generations of Computers
5 Structure of a basic Computer System
6 Classification of Computers by Size
7 Programming Languages
Eyob S. (AAiT) Computer Programming April 2, 2025 2 / 50
Course Introduction
Course Outline
Eyob S. (AAiT) Computer Programming April 2, 2025 3 / 50
Course Introduction
Chapter 1: Introduction
Computer Programming, Computer Science, Computation
History of computing and programming
Generations of Computers
Structure of a Basic Computer System
Classification of Computers by Size
Programming Languages
Eyob S. (AAiT) Computer Programming April 2, 2025 4 / 50
Course Introduction
Chapter 2: Variables, Expressions and Statements
Variables, Expressions and Statements
Order of Operations
Data Types
TypeErrors and Type Conversions
Debugging
Comments
Eyob S. (AAiT) Computer Programming April 2, 2025 5 / 50
Course Introduction
Chapter 3: Conditionals and Iterations
Algorithm
Boolean Expressions
Types of Program Execution
Conditionals
Iterations
Eyob S. (AAiT) Computer Programming April 2, 2025 6 / 50
Course Introduction
Chapter 4: Functions
Functions
Types of Functions
Parameters and Arguments
Variable Scopes
Eyob S. (AAiT) Computer Programming April 2, 2025 7 / 50
Course Introduction
Chapter 5: Python Data Structures
Data Structure
String
List
Tuple
Dictionary
Set
Eyob S. (AAiT) Computer Programming April 2, 2025 8 / 50
Course Introduction
Chapter 6: Persistence and OOP
Persistence
Object Oriented Programming
Eyob S. (AAiT) Computer Programming April 2, 2025 9 / 50
Course Introduction
Teaching Method: Lecture supported by Laboratory
Continuous Assessments ............... 50%
Final Exam................. 50%
Eyob S. (AAiT) Computer Programming April 2, 2025 10 / 50
Computer Programming, Computer Science, Computation
Computer Programming, Computer
Science, and Computation
Eyob S. (AAiT) Computer Programming April 2, 2025 11 / 50
Computer Programming
Computer: A programmable electronic device designed to accept data
(input), store the data as necessary (storage), process the data at high
speed (processing), and display the results of these operations (output).
([Link])
Programmable: The ability of a device to follow a set of instructions
(a program) to perform tasks automatically.
Programming: The process of designing and writing instructions (code)
that a computer can follow to perform specific tasks.
Computer Programming: The process of designing, writing, testing,
and maintaining a set of instructions (code) that a computer follows
to perform a specific task or solve a problem.
Eyob S. (AAiT) Computer Programming April 2, 2025 12 / 50
Computer Science
Computer Science is no more about computers than astronomy is about
telescopes. (Edsger Dijkstra (1930 - 2002)
There are theoretical works in CS, which do not make use of real com-
puters: even the early work in CS took place before the development
of the first computer.
Computer Science: the study of computers and computing, including
their theoretical and algorithmic foundations, hardware and software,
and their uses for processing information. [Link]
Eyob S. (AAiT) Computer Programming April 2, 2025 13 / 50
Computation
Computation: the act or process of calculating an answer or amount
by using a machine. [Link]
Computer science studies computation:
investigates problems that can be solved computationally
uses programming languages to describe computations
Computer science studies:
machines that carry out computations
theoretical limits of computation (what is or is not computable)
Eyob S. (AAiT) Computer Programming April 2, 2025 14 / 50
History
History of computing and programming
Eyob S. (AAiT) Computer Programming April 2, 2025 15 / 50
History of computing and programming
The earliest known calculating device is probably the abacus.
An abacus, also called a counting frame, is a hand-operated calculat-
ing tool which was used from ancient times in the ancient Near East,
Europe, China, and Russia.
Figure: Abacus
Eyob S. (AAiT) Computer Programming April 2, 2025 16 / 50
History of computing and programming
The first calculator or adding machine produced and actually used was
the Pascaline, or Arithmetic Machine, designed and built by the French
mathematician-philosopher Blaise Pascal between 1642 and 1644.
Charles Babbage (1791-1871), computer pioneer, designed two classes
of engine, Difference Engines, and Analytical Engines.
Difference engines are strictly calculators.
The Analytical Engine was to be a general-purpose, fully program con-
trolled, automatic mechanical digital computer.
Eyob S. (AAiT) Computer Programming April 2, 2025 17 / 50
History of computing and programming
Eyob S. (AAiT) Computer Programming April 2, 2025 18 / 50
History of computing and programming
Ada Lovelace (1815-1852), an
English mathematician and as-
sociate of Charles Babbage.
In her notes on the Analytical
Engine (published in 1843), she
included what’s considered the
first algorithm intended to be
processed by a machine.
She’s often celebrated as the
world’s first computer program-
mer.
Eyob S. (AAiT) Computer Programming April 2, 2025 19 / 50
Generations of Computers
Generations of Computers
Eyob S. (AAiT) Computer Programming April 2, 2025 20 / 50
1940 – 1956: (First Generation – Vacuum Tubes )
These early computers used vacuum tubes as circuitry and magnetic
drums for memory. These first generation computers relied on machine
language.
These computers were limited to solving one problem at a time. Input
was based on punched cards and paper tape. Output came out on
print-outs.
The two notable machines of this era were the UNIVAC and ENIAC
machines – the UNIVAC is the first commercial computer which was
purchased in 1951 by a business – the US Census Bureau.
Eyob S. (AAiT) Computer Programming April 2, 2025 21 / 50
1940 – 1956: (First Generation – Vacuum Tubes )
Eyob S. (AAiT) Computer Programming April 2, 2025 22 / 50
1940 – 1956: (First Generation – Vacuum Tubes )
Figure: left:ENIAC, right:UNIVAC
Eyob S. (AAiT) Computer Programming April 2, 2025 23 / 50
1956 – 1963: (Second Generation – Transistors)
The language evolved from cryptic binary language to symbolic (‘as-
sembly’) languages. About the same time high level programming
languages were being developed (early versions of COBOL and FOR-
TRAN).
Transistor-driven machines were the first computers to store instruc-
tions into their memories – moving from magnetic drum to magnetic
core ‘technology’.
The early versions of these machines were developed for the atomic
energy industry.
Eyob S. (AAiT) Computer Programming April 2, 2025 24 / 50
1964 – 1971: (Third Generation – Integrated Circuits)
By this phase, transistors were now being miniaturised and put on
silicon chips (called semiconductors).
This led to a massive increase in speed and efficiency of these machines.
These were the first computers where users interacted using keyboards
and monitors which interfaced with an operating system
Eyob S. (AAiT) Computer Programming April 2, 2025 25 / 50
1972 – 2010: (Fourth Generation – Microprocessors)
In the third-generation, different circuits were present on different ICs.
Finally, all these different circuits were made on a single IC called the
microprocessor.
Intel developed the Intel 4004 chip in 1971, which positioned all com-
puter components (CPU, memory, input/output controls) onto a single
chip.
Other major advances during this period have been the Graphical user
interface (GUI), the mouse and more recently the astounding advances
in lap-top capability and hand-held devices.
Eyob S. (AAiT) Computer Programming April 2, 2025 26 / 50
Transistors, ICs, and MPs
Eyob S. (AAiT) Computer Programming April 2, 2025 27 / 50
2010. . . : (Fifth Generation – Artificial Intelligence)
Computer devices with artificial intelligence are still in development
AI is a reality made possible by using parallel processing and supercon-
ductors. Leaning to the future, computers will be radically transformed
again by Quantum Computation, Molecular and Nano Technology.
The essence of fifth generation will be using these technologies to ul-
timately create machines which can process and respond to natural
language, and have capability to learn and organise themselves.
Eyob S. (AAiT) Computer Programming April 2, 2025 28 / 50
AI
Eyob S. (AAiT) Computer Programming April 2, 2025 29 / 50
Structure of a basic Computer System
Structure of a basic Computer System
Eyob S. (AAiT) Computer Programming April 2, 2025 30 / 50
System
The word ‘system’ is used to describe any organization or device that
includes three features: Input, Output, and process.
Often there are many inputs and outputs. Some of the outputs are
required and some are waste products. To a greater or lesser extent,
all processes generate some waste heat.
Eyob S. (AAiT) Computer Programming April 2, 2025 31 / 50
Internal organization of computers
The internal working of every computer can be broken down into
three parts:
CPU(central processing unit), memory, and I/O (input/output) devices.
The function of CPU is to execute (process) information stored in
memory whereas the function of I/O devices such as the keyboard and
video monitor is to provide a means of communicating with the CPU.
The CPU is connected to memory and I/O through strips of wire
called a bus.
Eyob S. (AAiT) Computer Programming April 2, 2025 32 / 50
Internal organization of computers
Eyob S. (AAiT) Computer Programming April 2, 2025 33 / 50
Classification of Computers by Size
Classification of Computers by Size
Eyob S. (AAiT) Computer Programming April 2, 2025 34 / 50
Supercomputers
These are arguably the most powerful in terms of speed and accuracy.
They are useful in problems that require complex mathematical com-
putations.
They are capable of executing trillions of instructions per second, which
is calculated in floating point operations per second (FLOPS). They
also don’t come cheap as they can be priced between 200, 000 to over
100 million.
Eyob S. (AAiT) Computer Programming April 2, 2025 35 / 50
Mainframes
Mainframe computers are large and powerful machines. However, they
fall short in terms of the computation ability seen in supercomputers.
They are like big file servers, enabling multiple users from nearby and
remote locations to access resources at the same time.
Users access the mainframe using terminals or personal computers.
This can happen within the same building or via wide area network
(WAN).
Eyob S. (AAiT) Computer Programming April 2, 2025 36 / 50
Minicomputers
Also known as mid-range computers, these became popular in the late
1960s but have become almost extinct because of the popularity of
personal computers.
They became popular for control related functions as opposed to com-
puting purpose. Over the years, their usage was limited to dedicated
control assignments in mid-range organizations.
Eyob S. (AAiT) Computer Programming April 2, 2025 37 / 50
Servers
These are systems which are designed to provide resources, services
and functionality to client computers in a server-client network model.
Resources provided are based on the functions of a particular server,
which may fall under these categories: File server, Database server,
Print server, FTP servers, Application server, and Web server.
Servers are optimized to run 24 hours and are capable of hot swapping
of storage and other hardware without having to shut down the system.
Eyob S. (AAiT) Computer Programming April 2, 2025 38 / 50
Microcomputers/Personal Computers
Microcomputers are the smallest, least expensive and the most used
computer systems. They have a small memory, less processing power,
are physically smaller, and permit fewer peripherals compared to super
and mainframe computers.
They are more commonly known as personal computers or simply PCs.
Categories of personal computers include: Desktop computers, Mobile
computers, Wearable computers.
Eyob S. (AAiT) Computer Programming April 2, 2025 39 / 50
Single Board Computers
These are the smallest possible computers which mimic the shape and
functionality of full-size desktop motherboards.
An SBC can easily be confused with an embedded system because of
its size but is not, because it permits general purpose functionalities
synonymous with microcomputers.
Eyob S. (AAiT) Computer Programming April 2, 2025 40 / 50
Mobile Computers and Wearable Gadgets
The most common types of mobile computers include: Laptop com-
puters, Tablets, Smartphones, Personal Digital Assistants (PDA).
Wearable Gadgets, wearable computers, or simply wearables, are minia-
ture devices that are designed to be worn or attached onto your body.
Examples of these devices include smart watches, smart glasses, smart
clothes, smart shoes.
Eyob S. (AAiT) Computer Programming April 2, 2025 41 / 50
Embedded Systems
These are microprocessor-based systems which are standalone elec-
tronic hardware designed to perform dedicated computing tasks. They
are not general purpose installations like the personal computer.
The old cell phones used well before the smartphones became a phe-
nomenon, could easily fall under the category of embedded systems
since their sole purpose was to make and receive calls.
Smartphones today, however, have evolved into general purpose mo-
bile computers. Firmware on these systems is written in the read-only
memory (ROM) or flash memory chips.
Eyob S. (AAiT) Computer Programming April 2, 2025 42 / 50
Programming Language
Programming Language
Eyob S. (AAiT) Computer Programming April 2, 2025 43 / 50
Programming Language
A program is a set of instructions written in a particular programming
language to solve a problem.
Programming Language: A formal language used to give instructions
to a computer to perform specific tasks.
It consists of syntax (rules) and semantics (meaning), allowing humans
to write code that computers can understand and execute.
Eyob S. (AAiT) Computer Programming April 2, 2025 44 / 50
Programming Languages
Low-Level: Close to hardware, fast but complex (e.g., Assembly).
High-Level: Easy to use, abstracted from hardware (e.g., Python,
C#).
Interpreted: Runs via an interpreter (e.g., Python, JavaScript).
Compiled: Translated to machine code before execution (e.g., C++).
Eyob S. (AAiT) Computer Programming April 2, 2025 45 / 50
Programming Language
Eyob S. (AAiT) Computer Programming April 2, 2025 46 / 50
Why Python?
Guido Van Rossum: Dutch programmer best known as the creator of
the Python programming language.
Philosophy: Code readability, few lines of code
General Purpose, Interpreted, High level
Eyob S. (AAiT) Computer Programming April 2, 2025 47 / 50
Fixed program & Stored-program Computers
A stored-program digital computer keeps both program instructions
and data in read–write, random-access memory (RAM).
Changing the program of a fixed-program machine requires rewiring,
restructuring, or redesigning the machine.
Eyob S. (AAiT) Computer Programming April 2, 2025 48 / 50
ASCII
Eyob S. (AAiT) Computer Programming April 2, 2025 49 / 50
End of Chapter
Thank You!!!
Eyob S. (AAiT) Computer Programming April 2, 2025 50 / 50