Transcript lecture 8
Lecture (8)
Programming Design
Dr. Emad Elsharkawy
Eng- Omar Salah
Dr:Emad Elsharkawy
1
Monday, 11 April 2016
Items :
1.A Layered View of the Computer.
2.programming languages.
3.Computer Languages.
4.Binary Number System
5.What is Programming?
6.Steps of Programming.
Dr:Emad Elsharkawy
2
Monday, 11 April 2016
A Layered View of the Computer
Application Programs
Word-Processors, Spreadsheets,
Database Software, IDEs,
etc…
System Software
Compilers, Interpreters,Preprocessors,
etc.
Operating System, Device Drivers
Machine with all its hardware
Programs
•Programs are written in programming
languages
•PL = programming language
•Pieces of the same program can be written in
different PLs
•Languages closer to the machine can be more
efficient
•As long as they agree on how to communicate
• A programming languages is:
– A special purpose and limited language
– A set of rules and symbols used to construct
a computer program
– A language used to interact with the
computer
Dr:Emad Elsharkawy
5
Monday, 11 April 2016
Computer Languages
–Machine Language
•Uses binary code
•Machine-dependent
•Not portable
•Assembly Language
•Uses mnemonics
•Machine-dependent
•Not usually portable
• High-Level Language (HLL)
– Uses English-like language
– Machine independent
– Portable (but must be compiled for different
platforms)
– Examples:, C, C++, Java
Dr:Emad Elsharkawy
7
Monday, 11 April 2016
Computer Language
•Digital devices have two stable states, which are
referred to as zero and one by convention
•The binary number system has two digits, 0 and
1. A single digit (0 or 1) is called a bit, short for
binary digit. A byte is made up of 8 bits.
•Binary Language: Data and instructions
(numbers, characters, strings, etc.) are
encoded as binary numbers - a series of bits
(one or more bytes made up of zeros and
ones)
Binary Number System
•Decimal
•Base 10, ten digits (0-9)
•The position (place) values are integral powers of 10:
100(ones), 101(tens), 102(hundreds), 103(thousands)…
•n decimal digits - 10n unique values
•Binary
•Base 2, two digits (0-1)
•The position (place) values are integral powers of 2:
20(1), 21(2), 22(4), 23(8), 24(16), 25(32), 26(64)…
•n binary digits - 2n unique values
What is Programming?
• Programming is software development
• Six step procedure
1.
2.
3.
4.
5.
6.
Program specification
Program design
Program code
Program test
Program documentation
Program maintenance
1-11
Step 1
Program Specifications
14-12
Step 2
Program Design
•Plan a solution
•Use structured programming techniques
•Top-down program design
•Pseudocode
•Flowcharts
•Logic structures
14-13
Top-Down Program Design
14-14
Flowchart Symbols
14-15
Logic Structures
•Sequence structure
•Selection structure
•Loop structure
14-16
Step 3
Program Code
•Coding
•The good program
•Reliable
•Well documented
•Understandable to other
programmers
•Structured programs best method
14-17
Step 4
Program Test
•Debugging
•Testing
•Eliminating errors
•Syntax errors
•Logic errors
•Testing processing
14-18
Step 5
Documentation
•Written descriptions and procedures about a
program
•Important for people who will use the
program
•Users
•Operators
•Programmers
14-19
Step 6
Program Maintenance
•75% of total lifetime cost
•Error-free operations
•Effective program
•Two categories
•Operations
•Changing needs
14-20
Object-Oriented Software
Development
•Focuses less on procedures, more on
relationship between objects
•OOP: Object-oriented programming
•Object contains both the data and the
processing operations
14-21
Generations of Programming
Languages
•Occurring in “generations”
•Levels
•Machine languages to natural languages
•Lower level closer to machine language
•Higher level closer to human-like language
14-22
Thanks
Dr:Emad Elsharkawy
23
Monday, 11 April 2016