Presentation is loading. Please wait.

Presentation is loading. Please wait.

Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department.

Similar presentations


Presentation on theme: "Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department."— Presentation transcript:

1 Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department

2 Lecture 1 – Introduction to Computers and C Programming hardware components 1. Introduction:

3 cont Computer is a device capable of performing computations and making logical decisions at speeds millions and even billions of times faster than human beings. Computers process data under the control of sets of instructions called computer programs. Programming is the process of writing instructions for a computer in a certain order to solve a problem. The computer programs that run on a computer are referred to as software (SW). While the hard component of it is called hardware (HW). Developing new software requires written lists of instructions for a computer to execute. Programmers rarely write in the language directly understood by a computer.

4 2. Short History of languages: The following is a short history, just for given a general view of how languages are arrived:  1954: Fortran.  1957: Cobol.  1958: Algol (Base for Simula).  1958: Lisp.  1961: B1000.  1962: Sketchpad.  1964: Basic.  1967: Simula67.  1968: FLEX.  1970: Pascal (From Algol).  1971: C (From a language called B).  1972: Smalltalk72 (Based on Simula67 and Lisp).  1976: Smalltalk76.  1979: ADA (From Pascal).  1980: C with classes (experimental version).  1983: C++ (by Bjarne Stroustrup).  1986: Objective-C (from C and Smalltalk).  1986: Eiffel (from Simula).  1991: Sather (From Eiffel).  1991: Java.  2000: C#.

5 3. Computer Organization Six logical units in every computer: 1.Input unit Obtains information from input devices (keyboard, mouse) 2.Output unit Outputs information (to screen, to printer, to control other devices) 3.Memory unit Rapid access, low capacity, stores input information 4.Arithmetic and logic unit (ALU) Performs arithmetic calculations and logic decisions 5.Central processing unit (CPU) Supervises and coordinates the other sections of the computer 6.Secondary storage unit Cheap, long-term, high-capacity storage Stores inactive programs

6 4. What is C C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. In the late seventies C began to replace the more familiar languages of that time like PL/I, ALGOL, etc. No one pushed C. It wasn’t made the ‘official’ Bell Labs language. Thus, without any advertisement C’s reputation spread and its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, that's what happened. Possibly why C seems so popular is because it is reliable, simple and easy to use.[ www.kicit.com/books/letusc].

7 5. Structured Programming Structured programming – Disciplined approach to writing programs – Clear, easy to test and debug and easy to modify Multitasking – Specifying that many activities run in parallel

8 6. Basics of a Typical C Program Development Environment Phases of C Programs: 1.Edit 2.Preprocess 3.Compile 4.Link 5.Load 6.Execute Preprocessor program processes the code. Loader puts program in memory. CPU takes each instruction and executes it, possibly storing new data values as the program executes. Compiler creates object code and stores it on disk. Linker links the object code with the libraries Loader Primary Memory Compiler Editor Preprocessor Linker Primary Memory........................ Disk CPU Disk


Download ppt "Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department."

Similar presentations


Ads by Google