Sei sulla pagina 1di 23

1

1.0 2.0

Introduction To Programming
Basic C++ Program Program Control

3.0
4.0 5.0

Array And Structures


Function Pointer

6.0
PN NORHASLIZA BT MUHAMAD NOR

Define computer program, programmer and programming language

State the importance of programming in system development

Explain the system development phase that involves programming

Program A set of step-by-step instructions that directs a computer to perform a specific task and to produce the required results. Programmer Programmer is a person who writes the program. Programming Language A set of rules and reserved words (keywords) that can be used to tell a computer what are the operations to be done. Now, there are over 200 programming languages in the world. For example: Cobol, Pascal, C, C++, and Fortran.

Programming Life Cycles


Life Cycle: Refers to the changes made from an old to a new program (the cycle starts again). Programming Life Cycle: A framework or discipline, which uses certain techniques needed in computer programming development.

Programming Life Cycles


PROBLEM ANALYSIS

PROGRAM DESIGN

PROGRAM CODING

TESTING AND DEBUGGING

MAINTENANCE AND DOCUMENTATION

Step 1 : PROBLEM ANALYSIS


Purpose: To describe in detail a solution to a problem and information needed in solving the problem. How? Study and understand the problem. Identify: The needed input. The required output. The needed process. For example: scientific formula or particular theories.

Step 2: PROGRAM DESIGN


Definition: It is a framework or flow that shows the steps in problem solving. Methods to design a program: Algorithm Algorithm is a sequence of instructions to solve a problem, written in human language. A programmer writes the problem solving in the form of an algorithm before coding it into computer language. Flowchart A representation of graphical symbols to show process or steps in problem solving. Pseudo code Steps in problem solving that is written half in programming code and half in human language. For example, some part uses C language code and some part uses Malay or English language.

Step 3 : PROGRAM CODING


Definition: Writing problem solving into certain programming language such as C, COBOL and others. Problem solving: Instructions before it is coded into programming language. Purpose: To produce a program to develop a system.

10

Step 4:TESTING & DEBUGGING


Definition of Testing: Using a set of data to discover errors and to ensure accuracy of the program. Testing Process: Diagram indicates the process of testing:

Input sample of data set

Executing Program

Output (functioning well or error discovered)

11

Step 4:TESTING & DEBUGGING


Definition of Debugging: An error is known as bug. Debugging is a process of identifying and correcting error. Three types of error: Compile error Logic error Run time error

12

Step 5:MAINTENANCE & DOCUMENTATION


MAINTENANCE Definition: Activity that verifies whether the operational system is performing as planned or an activity to modify the system to meet the current requirement. Programmer will change the old system to a new system and test the system whether it is functioning well or not. Any old function that is no longer used will be replaced with a new function (replacement).

13

Step 5:MAINTENANCE & DOCUMENTATION


MAINTENANCE (cont) The process of changing a system after it has been applied to maintain its ability. The changes may involve simple changes such as error correcting. Then, the new systems overall capability will be tested. How to do maintenance? By performing activities such as: Testing Test the ability of the system. Measurement Access data time. Example, time to save, print and others. Replacement Replace the old system to new system. Adjustment Adding needs to new system. Repair For example: An old system cannot update the new data Updating Update the database.

14

Step 5:MAINTENANCE & DOCUMENTATION


DOCUMENTATION Definition: A written or graphical report of the steps taken during the development of a program. Purpose: It will be useful in the future, in case of modification or maintenance. Content of Documentation: Description of the program. Specification of program requirement Program design such as algorithm, pseudo code and flowchart List of program and comments (to explain about the program). Test results. Users manual book. Program capabilities and limitation.

15

16

Describe the compiling process of a program

Explain the types of error

17

1.

Syntax Checking: Once the code is updated based on the preprocessing, the code can be checked for valid syntax. This includes things like checking for semicolons, matching braces, every "begin" has an "end", etc. This doesn't mean the code is correct, but it does determine whether the code can be turned into machine code as written. 2. Converting To Assembly: This step doesn't exist for all languages/compilers. Java, obviously, doesn't use this step. Some compilers may go straight to machine code. GCC supports various languages, so converting all programs to Assembly makes converting to machine code much easier.

18

3.

Converting to Machine Code: What counts as machine code varies somewhat. Java goes to byte code (.class files). GCC creates object files. This step creates a file that is PART of the final program. 4. Linking Machine Code Into An Executable: Frequently, functions that are used by a program are defined in separate files. Delphi uses components that are in a variety of different files (especially commercially sold components). C/C++ use a variety of libraries. Java often merges .class files into a .jar file. At this step, many linkers will do final checks to make sure all the required pieces, functions, components, etc have been accounted for.

19

ERRORS

Compile Time

Run Time

Logical

20

a. Compile Time Error


Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors from the compiler itself, or syntax errors in the code. A compilation error message often helps programmers debugging the source code for possible syntax errors.

21

b. Run Time Error


Run time error - refers to the period while a computer program is actually executed ("run") in a computer, from beginning to termination. It may also mean the program's running time, the duration of that period. Run time errors can be caused by attempting to do impossible arithmetic operations such as calculate with non-numeric data or divide by zero.

22

c. Logical Error
Logical errors - Errors that indicate the logic used when coding the program failed to solve the problem.
You do not get error messages with logic errors. Your only clue to the existence of logic errors is the production of wrong solutions.

23

ADDITIONAL !!!
Syntax errors - Errors in spelling and grammar.
You can use the compiler or interpreter to uncover syntax errors. You must have a good working knowledge of error messages to discover the cause of the error.

Potrebbero piacerti anche