Professional Documents
Culture Documents
Algorithms and Problem Solving CSBP 119: CIT, UAE University
Algorithms and Problem Solving CSBP 119: CIT, UAE University
CSBP 119
Chapter 1
An Overview of Computers and Programming Languages
CIT, UAEU. 2
History of
Computers
An Overview
CIT, UAEU. 3
The basic commands a computer performs:
Elements Input - The data provided to the computer
Output - Results of the processing that is
of a provided by the computer
Storage
Computer Processing – arithmetic and logical
System operations.
CIT, UAEU. 4
Hardware /
CPU
Control Unit (CU)
Arithmetic Logic Unit
(ALU)
Program Counter (PC)
Instruction Register (IR)
CIT, UAEU. 5
Ordered sequence of
cells (memory cells)
which are uniquely
addressed.
Hardware / Programs loaded into
Main main memory before
execution
Memory Volatile state i.e., when
power is turned off,
everything in main
memory is lost
CIT, UAEU. 6
7 Hardware / Secondary Storage
CIT, UAEU.
Machine Language
Basic language of a computer
A sequence of 0s and 1s (off and on)
CIT, UAEU. 10
Binary Units
CIT, UAEU. 11
12 Evolution of Programming Languages
Machine Language
Early computers were programmed in
machine language (only using zero’s and
one’s)
Assembly Language
Programming is made easier.
An instruction is an easy-to-remember form
called a mnemonic
Assembler: a software that translates
assembly language instructions into machine
language
CIT, UAEU.
What programmer easily What Computer understands.
understands.
High-Level Languages
Makes programming easier for users.
Closer to spoken language (English)
Examples
Java, Basic, Quick Basic, Visual Basic,
FORTRAN, COBOL, C/C++, etc.
Well-known language constructs
If-then-else
do-while
for
integer, String, char, etc.
CIT, UAEU.
15 Evolution of Programming Languages
Stop
Bugs/errors/mistakes
High level programing Machine code
language Compiler/Interpreter
CIT, UAEU.
Java Programing Language Java Virtual Machine (JVM): Java
hypothetical computer
developed to make Java Programming
Java is a machine-independent language
programs machine independent.
Language
Java program is written using the Java
syntax
• Syntax is the grammar for the
instructions/commands.
CIT, UAEU. 16
17 Java Programming Language
Java Machine
program Bytecode Code
Java compiler Java Interpreter
CIT, UAEU.
Source program:
written in a high-level
language
CIT, UAEU. 18
Problem Solving
Problem-Analysis-Coding-Execution Cycle
CIT, UAEU. 19
1 2 3
Analyze the problem Implement the Maintain the program
• Outline solution algorithm in a • Use and modify if the
requirements and design an programming language problem domain or
algorithm (Java) and verify if the requirement changes
algorithm works
Problem Solving
CIT, UAEU. 20