ITEC18: Introduction To Programming

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ITEC18

Lecture 1

Introduction to Programming
Definition of Program
• Set of step-by-step instruction that directs the computer to do the task you want it to do and produce the
result wanted.
Definition of programming language
• Set of rules that provide a way of telling the computer what to perform.
• Set of commands that formulated by the user and executed by the computer
Programming – the task of creating a software
Why programming?
1. It helps us understand more the computer which is considered as a computer tool.
2. Let’s you find out quickly whether you like programming or not and whether you have analytical turn of
mind that the programmer needs.
What do programmers do?
✓ Makes / execute program.
✓ Covert problems and solution to computer instruction.
✓ Prepare instruction of program, runs, tests and debug the program.
✓ Write a report in the program.
✓ Perform changers on programs because of a new requirement.

Programming Process
• Defining the problem
- determine the problems the program must meet
o Input – data / requirements that are inputted
o Process – the operations
o Output – shows the result

• Planning the solution


- selects the best method for solving the problem
o Algorithm / Pseudocode
o Flowchart

• Coding the program


- Prepare the set of instructions for the computer to execute

Requirements in coding
1. Correct use of language.
2. Coded program must be keyed in a form that the computer can understand.
Ex. of programming languages – BASIC, COBOL, Pascal, FORTRAN and C language

• Testing the program


- perform debugging and testing the program using representative input data

Methods
1. Disk Checking – proofreading.
2. Translating – translate a coded program to be understood by the computer thru the use of a
translator.
Two types of translator
➢ Interpreter – translate the program one at a time.
➢ Complier – translate the entire program at one time giving you the syntax error message.

3. Debugging – directs, locates and corrects bugs by running the program.


Bugs – errors in program
2 types of bugs
➢ Syntax error – errors in spelling or grammar
➢ Semantics error – logical error, incorrect solution
Signs of semantically wrong statement
o Incorrect results are displayed
o Confusing or garbled output
o Program hangs
o Run time errors are displayed and program terminates

• Documenting the program


- write up the full specifications for other program users.
- used to make programs readable by other programmers.

Documentation – description of the program cycle and specifies the acts about the program.
Comment – an important part of program documentation.

Algorithm
– procedure, recipe of a program, a finite set of instruction.
Properties of algorithm
An algorithm must be
✓ Complete – such that all necessary information contained on it.
✓ Unambiguous – precisely defined / clear.
✓ Terminate on a finite number of operations.
Presentation of algorithm
✓ Pseudocode – textual representation, English like.
✓ Flowchart – graphical representations.

You might also like