01 - Introduction
01 - Introduction
Programming
CSE 011, Level-0
Computer and Systems Engineering
Department
Faculty of Engineering - Alexandria
University
Welcome
We wish you a successful and fruitful semester
2
Course Code & Policy
• Attending the lectures is mandatory
• Always use your academic email in communications with us
• Questions and discussions
• In lectures, or
• Office hours, or
• Microsoft Teams
• There is no Website or Social medial forums for the course.
• In case of vacations or days off, please attend the lecture or
the lab with any other group that suits your timetable.
4
Grades Policy
5
Teams
Announcements Only
(Grades, Timetable changes, … )
Download Labs
8
2
10
References
Charles R. Severance
Python for
Everybody
Book website:
https://www.py4e.com/
11
References
12
Course Contents
Week Lecture Reference
1 Introduction Python for All: Chapter 1
2 Variables, expressions and statements Python for All: Chapter 2
3 Conditional Execution Python for All: Chapter 3
4 Functions Python for All: Chapter 4
5 Loops and Iterations Python for All: Chapter 5
6 Strings & Lists Python for All: Chapter 6 & 8
7 Dictionary & Tuples Python for All: Chapter 9 & 10
8 Midterm
9 Introduction to Database Systems Understanding Computers: Chapter 14
10 Using Databases & SQL Python for All: Chapter 15
11 Hardware (Processing and Memory) Understanding Computers: Chapter 2
12 Computer Networks and Internet Understanding Computers: Chapter 7
13 Introduction to Machine Learning
13
Lecture 1
• Why
• Computer Systems main functions
• Computer Systems main components
• Program Development Life Cycle
• Programming Languages
• Translators and Compilers
• Algorithms Design
15
Why do we study this course?
16
Why do we study this course?
17
Computer Definition
18
Computer Functions
Input
Storage Processing
Output
19
Computer System
Software Data
Hardware
Information
20
Computer System: Data vs. Information
• Data are the set of facts such as Data
symbols, words, pictures, video,
numbers that represents the inputs to
the computer
21
Computer System: Hardware
Hardware
22
Computer System: Software
23
Software Types
• System Software are all the software that control and supervise
computer components (both software and hardware).
Example: Operating Systems (e.g., Windows, Unix, Mac, Android, ….)
24
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
25
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
26
1. Problem Analysis
• Clearly specify and understand the problem
• Programmers need accurate and detailed
requirements Input
• You must define
• Inputs: the data received from the users
• Outputs: the desired outcomes and the Time
Table
screens and the formats
Specs
• Features and specifications and approve
it from the customer
• Time Plan to complete the development
• Programming Language that will be used
and how the program will interact with Output
other programs
Programming
Language
27
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
28
2. Program Design
29
Pseudocode vs Flowchart
Example: Given a length in meter, calculate it in centimeter
Flowchart Pseudocode
Start • Read length in meter
• Multiply length by 100
Read length in • Write length to represent its value in
meter centimetre
More
Length in about
cm = 100 * Flowcharts at the end
length in m of the lecture
Write length in
centimeter
End
30
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
31
3. Program Coding
32
Low-level Languages
33
Machine Language – Low Level
34
Assembly Language – Low Level
• Limitations
• Each processor type has its own Assembly language.
• The developer must be fully aware of the processor design.
• Very detailed and needs long time and big effort to write.
• Advantages
• Fully utilizes the processor.
• Programs written using assembly languages execute faster.
35
High-level Languages
• Aims
• Increase programmers’ productivity
• The programmer doesn’t need to understand the hardware details.
• Its commands are English-like (e.g., print, input, copy).
• High-level languages processors are needed to transform the programs
written using a high-level language into a low-level language.
• Examples: FORTRAN, Pascal, (C, C++, and C#), Java, Python :
• Advantages:
• Loosely coupled to hardware
• Easy to learn
• Easy to find and correct errors
• Save time and effort
36
Language Processor
37
Language Processor
Language Processor Types
• Assembler: transforms the language written in assembly to
its equivalent machine code.
• Compiler: transforms all the source program into object
program before its execution.
• Interpreter: translates and executes the source program line
by line.
• Each high-level language has its own Compiler or Interpreter
38
Language Processor
What is the difference between compilers and
interpreters?
• Programs that use interpreters are slower than the programs that use
compilers because interpreters translate the program each time the
program is executed.
• Compiled programs need more memory than the program that uses
the interpreter.
• Interpreted programs are easy to stop at any line then resume its
execution which makes it easier to test and modify.
39
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
40
4. Program Debugging and Testing
41
Compile-Time error
X = Y * 10o0
Run-Time error
Input Z
X=Y/Z
Logical error
Input x
Input y
z=x-y
Print “sum =”, z
42
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
43
5. Program Maintenance
44
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Progra
Debugging
& Testing m
Coding
45
Program Development Life Cycle (PDLC)
Problem
Analysis
Progra
Program
Maintenance m
Design
Documentation
Progra
Debugging
& Testing m
Coding
46
Documentation
47
Flowcharts
48
Flowcharts
49
Main Flowchart symbols
1 2
Connector
50
Flowcharts Control Structures
F For I=1 to 10
T
T
F T
T Next I
Read length in F
F
meter
F
Length in cm = 100 *
length in m
51
Flowcharts Guidelines
52
Example
Start
Input A, B
X=A
Write an algorithm that
SUM=0 prints the sum of numbers
that are divisible by 5
No starting from a number A
X<=B
that is divisible by 5 and
Yes
ending with the nearest
number that is less than or
SUM=SUM+X Print SUM
equal to a number B.
X=X+5
End
53
Thank You …