Lec#1 - Intro Updated
Lec#1 - Intro Updated
LANGUAGE I
Computer Lecture 1: Introduction to computers & problem
Science solving
Lecture Contents
2
Course Info.
Problem Solving Techniques
Pseudocode
Algorithm
Flow charts
Examples
Elements of a Computer system.
Evolution of programming languages
The code Life Cycle
dr. Amal Khalifa,Fall14
Course info
3
Problem analysis–coding–execution
11
cycle
hint: I feet = 30 cm
Flowchart
Step 1: Input Lft START
Print
Lcm
STOP
Pseudocode
Input the radius (r) of a circle
A Pi x r x r
Print A
Algorithm START
Step 3: Print A
A Pi x r x r
Print
A
STOP
Algorithm: Input
a, b, c
Step 2: d sqrtb
( b 4 a c ) x1 (–b + d) / (2 x a)
Step 3: x1 (–b + d) / (2 x a)
X2 (–b – d) / (2 x a)
Step 4: x2 (–b – d) / (2 x a)
Step 5: Print x1, x2 Print
x1 ,x2
STOP
Elements of a Computer
29
System
Hardware
Computer
Software
32 Binary Data
Bit: A binary digit 0 or 1.
A sequence of eight bits is called a byte.
dr. Amal Khalifa,Fall14
ASCII Code
33
Every letter,
number, or
special symbol
(such as * or {)
on your
keyboard is
encoded as a
sequence of
bits, each
having a
unique
representation.
The most
commonly
used American
Standard Code
for Information
Interchange
(ASCII).
A set of
Symbols (punctuation),
Special words or keywords (vocabulary),
And rules (grammar)
used to construct a program.
Languages differ in
Size (or complexity)
Readability
Expressivity (or writability)
"Level"
closeness to instructions for the CPU
Binary-coded instructions
Address Contents
Used directly by the CPU
2034 10010110
Lowest level language
2035 11101010
Every program step is ultimately
2036 00010010
a machine language instruction2037 10101010
2038 10010110
2039 11101010
2040 11111111
2041 01010101
2042 10101101
MUL X,10
ADD X,Y
Mnemonic Instruction STO Z,20
ADD 10010011 SUB X,Z
source
program.
Saved in
File
ClassName
.java