Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Overview of Programming Principles of Computers.

Similar presentations


Presentation on theme: "1 Overview of Programming Principles of Computers."— Presentation transcript:

1

2 1 Overview of Programming Principles of Computers

3 2 Why Take This Course? l To complete your degree plan and graduate! l To understand what computer programs can do and how they do it l To learn to write programs in the C++ language

4 3 Some Definitions l Computer a programmable device that can... store, retrieve, and process data l Computer Programming the process of planning a sequence of steps for a computer to follow l Computer Program a list of instructions to be performed by a computer

5 4 Computer Components Arithmetic Logic Unit Memory Unit ( RAM & Registers ) Control Unit Input Device Output Device Auxiliary Storage Device Auxiliary Storage Device Central Processing Unit ( CPU )

6 5 Writing a Program l Problem-Solving Phase –understand what the program is supposed to do –develop a logical sequence of steps (an algorithm) that solves the problem l Implementation Phase –translate the algorithm into a programming language –test the program for both syntax and logic

7 6 More Definitions l Programming Language a series of rules, symbols, and special words used to construct a program l Machine Language made up of binary-coded instructions (0’s and 1’s) that is used directly by the computer at its lowest level l Compiler a program which translates from a high level programming language into machine language

8 7 Creating a Program l You use a text editor to write the source code

9 8 Creating a Program l You run the compiler to translate the source code into object code l The linker runs to combine the object code and library routines to make executable code

10 9 Three Program Stages other code from libraries, etc. other code from libraries, etc. written in machine language written in machine language written in machine language written in machine language written in C++ written in C++ via compilervia linker SOURCEOBJECT EXECUTABLE myprog.cppmyprog.objmyprog.exe

11 10 Creating a Program l Run the program Observe the output Respond with input

12 11 Creating a Program in This Class l We will use the Borland Turbo C++ programming environment l The Integrated Development Environment (IDE) provides … –text editor –compiler –linker l Available in the computer labs l You may also purchase your own copy

13 12 Basic Programming Structures l A sequence is a series of statements to be executed one after another. l Selection (branch) is a structure that executes different statements depending on certain conditions. l Looping (repetition) is a structure to repeat statements while certain conditions are met. l The subprogram is used to break the program into smaller units.

14 13 SEQUENCE Statement...

15 14 SELECTION (branch) IF Condition THEN Statement1 ELSE Statement2 Statement1 Statement Statement2 Condition... True False

16 15 LOOP (repetition) Statement Condition... False True WHILE Condition DO Statement1

17 16 SUBPROGRAM (function) SUBPROGRAM1... SUBPROGRAM1 a meaningful collection of SEQUENCE, SELECTION, LOOP, SUBPROGRAM Separately declared selection of statements Call of the subprogram


Download ppt "1 Overview of Programming Principles of Computers."

Similar presentations


Ads by Google