Lecture (8) Programming Design Dr. Emad Elsharkawy Eng- Omar Salah Dr:Emad Elsharkawy 1 Saturday, 13 February 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 Saturday, 13 February 2016
A Layered View of the Computer Machine with all its hardware System Software Compilers, Interpreters,Preprocessors, etc. Operating System, Device Drivers Application Programs Word-Processors, Spreadsheets, Database Software, IDEs, etc…
Programs Programs are written in programming languages 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 Saturday, 13 February 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 Saturday, 13 February 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: 10 0 (ones), 10 1 (tens), 10 2 (hundreds), 10 3 (thousands)… n decimal digits - 10 n unique values Binary Base 2, two digits (0-1) The position (place) values are integral powers of 2: 2 0 (1), 2 1 (2), 2 2 (4), 2 3 (8), 2 4 (16), 2 5 (32), 2 6 (64)… n binary digits - 2 n unique values
1-11 What is Programming? Programming is software development Six step procedure 1.Program specification 2.Program design 3.Program code 4.Program test 5.Program documentation 6.Program maintenance
14-12 Step 1 Program Specifications
14-13 Step 2 Program Design Plan a solution Use structured programming techniques Top-down program design Pseudocode Flowcharts Logic structures
14-14 Top-Down Program Design
14-15 Flowchart Symbols
14-16 Logic Structures Sequence structure Selection structure Loop structure
14-17 Step 3 Program Code Coding The good program Reliable Well documented Understandable to other programmers Structured programs best method
14-18 Step 4 Program Test Debugging Testing Eliminating errors Syntax errors Logic errors Testing processing
14-19 Step 5 Documentation Written descriptions and procedures about a program Important for people who will use the program Users Operators Programmers
14-20 Step 6 Program Maintenance 75% of total lifetime cost Error-free operations Effective program Two categories Operations Changing needs
14-21 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-22 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
Thanks Dr:Emad Elsharkawy 23 Saturday, 13 February 2016