Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.

Similar presentations


Presentation on theme: "Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms."— Presentation transcript:

1 Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms * Flowchart Introduction to Computers and Programming Dr. Ming Zhang

2 Basic Hardware Units of a Computer Central Processing Unit Arithmetic & Logic Unit Input Control Output Memory Second Storage Introduction to Computers and Programming Dr. Ming Zhang

3 Computer Software * Machine Language 11000000 000000000001 * Assemble Language ADD 1, 2 * High-Level Language Pascal, C, C++ * System Software DOS, UNIX * Applications Microsoft Word Introduction to Computers and Programming Dr. Ming Zhang

4 Programming Languages (1) Operation: Input (get the data) FORTRAN: READ BASIC: INPUT, READ/DATA COBOL: READ, ACCEPT Pascal: READ, READLN C: getchar(), gets(), scanf(), sscanf() C++: cin Introduction to Computers and Programming Dr. Ming Zhang

5 Programming Languages (2) Operation: Output (display the data) FORTRAN: WRITE, PRINT BASIC: PRINT, PRINT/USING COBOL: WRITE, DISPLAY Pascal: WRITE, WRITELN C: putchar(), puts(), printf(), sprintf() C++: cout Introduction to Computers and Programming Dr. Ming Zhang

6 Three Phase of Program Development Program Life Cycle Phase Maintenance(3) Documentation(2) Development and Design(1) Time Introduction to Computers and Programming Dr. Ming Zhang

7 Development and Design Steps Development & Design Steps Test & Correct Solution Code Solution Develop Solution Analyse Problem Time Introduction to Computers and Programming Dr. Ming Zhang

8 Algorithms * Definition of Algorithm An algorithm is defined as a step-by-step sequence of instructions that must terminate and describes how the data is to be processed to produce the desired outputs * Question for Developing an Algorithm In essence, an algorithm answers the question, “What method will you use to solve this problem?” Introduction to Computers and Programming Dr. Ming Zhang

9 Algorithm for Calculating the Average 1 Step1: input a, b, and c. Step2: calculate the average of a, b, and c. Step 3: display the average. step 4: stop. Introduction to Computers and Programming Dr. Ming Zhang

10 Algorithm for Calculating the Average 2 Step1: input value and assign value to A i, i = 1,2, 3,...n. Step 2: if no more input value, go to step 3, otherwise go to step 1 Step3: calculate the average of A i, i = 1,2, 3,...n. Step 4: display the average. Step 5: stop. Introduction to Computers and Programming Dr. Ming Zhang

11 Flowchart Symbols (1) Symbol Name Description Terminal Indicates the beginning or end of an algorithm Input/Output Indicate an Input or Output operation Process Indicates computation or data manipulation Introduction to Computers and Programming Dr. Ming Zhang

12 Flowchart Symbols (2) Symbol Name Description Flow Lines Used to connect the flowchart symbols and indicates the logic flow Decision Indicates a decision point in the program Loop Indicates the initial, final, and increment values of a loop Introduction to Computers and Programming Dr. Ming Zhang

13 Flowchart Symbols (3) Symbol Name Description Predefined Indicates a predefined Process Process, as in calling a sorting process ConnectorIndicates an entry to, or exit from, another part of the flowchart Introduction to Computers and Programming Dr. Ming Zhang

14 Flowchart for Calculating the Average 1 Start Input values for a, b, and c Calculate the average Display the average End Introduction to Computers and Programming Dr. Ming Zhang

15 Flowchart for Calculating the Average 2 Start Input values for A i End of Calculate the average N input? Y Display the average End Introduction to Computers and Programming Dr. Ming Zhang

16 Calculate the Average of 100 Numbers Starti = 1 i=i+1 Input values for A i Calculate the average N i=100? Y Display the average End Introduction to Computers and Programming Dr. Ming Zhang


Download ppt "Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms."

Similar presentations


Ads by Google