ITD1011- Introduction to IT. جـامعـــة الـجــزيــرة. UNIVERSITY OF JAZEERA. Dr. Mohamed Sammouda. Problem Solving and Computer Language. Chapter 5. Problem Solving using Computer. Steps Understanding of the problem ? Methods and Logic to solve the problem.
UNIVERSITY OF JAZEERA
Dr. Mohamed Sammouda
Understanding of the problem ?
Methods and Logic to solve the problem.
Flow-Chart /Algorithm / Decision Tables / Pseudo Code.
Computer language ? Coding ? (Programming)
Execution and producing the results.
Understanding of the problem :- Problem should be clear to us. We should know, what is given ? What is to be done ?
Methods and Logic to solve the problem : We should know how to solve the problem. If we don’t know the method and logic to solve the problem, the computer can’t help.
The computer can do these calculation at very high speed.
- An algorithm is a step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps.
An algorhthm is a step-by-step procedure for getting something done.
A good example of an algorithm is a recipe.
What is an ALGORITHM?
Walk from [your kitchen] to [your car].
Drive to [your local store].
Walk from [your car] into [your local store].
For each [listing] in [your shopping list]:
Find an [item] which matches [listing].
Put [item] into [your basket].
Pay for everything in [your basket].
Walk from [your local store] to [your car].
Get into [your car].
Drive to [your house].
Get out of [your car].
Walk from [your car] into [your kitchen].
What is an ALGORITHM?
So we have to give instructions in one of the computer languages ?
Program – Instructions written in computer language.
Low – level languages
High – level languages
Data Base languages
The low-level languages vary from machine to machine. If one learns and works on one machine, after changing the computer, one has to learn again new language for the new machine. That is why the computer remains with the manufactures or with the universities and with the research institutes.
Low – level languages are of two types
These codes vary from machine to machine. Learning of the machine language is difficult.
Symbols also vary from machine to machine.
BASIC – Beginners All Purpose Symbolic Instruction Code
FORTRAN – Formula Translation
COBOL – Common Business Oriented Language
PASCAL – Named after Blaisé Pascal
C – The latest and most powerful language.
Actual Processing is done in only in machine languages. All Assembly language and High level language programs have to be translated into the machine language of that particular machine.
There are three types of translators
Translator first finds the grammatical mistakes and if there is no grammatical mistake then translate it into the machine language.
ii) Interpreter : Check and translate the high – level language programs into the machine language line by line.
Interpreter is available only for BASIC language
iii) Compiler : Reads the whole high – level program, if there is no grammatical error, then it translates the whole program into the machine language.
Object Code : Translated program in machine language from high level languages.
There are two types of Errors
i) Syntax Errors
ii) Logic Errors
eg. - Diversion by zero.
- Square root of negative numbers.
- Number out of range, etc.
Object Program + Data Results
Actual processing is done with the object program. Any change or correction in the problem, has to be made first in the source program, then source program is translated into the object program. No direct change in the object program.
- Easy to use
- Much simpler
- Popular among non-professional
- Learning with less time
- Language as well as package
Package – Database languages have some command to do some jobs. Commands can be used directly and there is no need of any programming.
Other packages are :
Characters - A – Z, 0 – 9 Special Characters (Any character on the key board)
Field / Data item- Collecting of Characters
Record - Collection of Data items
File - Collection of Records
Data Base - Collection of Files
Data Base Structure :
NAME Character 20
D-O-B Date 8
Address Character 30
City Character 15
PIN Numeric 6
NAME D-O-B ADDRESS CITY PIN
1. RAM 15/10/93 145/Sec. – 15 Chandigarh 160015
2. SHAM 10/05/92 165/Sec.- 19 Chandigarh 160019
3. SITA 10/06/93 989/Sec.- 45 Chandigarh 160045
Creation of Data Base and Data-Base Structure
Entering the Data Records
Editing the Data Records
Adding New Records
Retrieving and Searching the records
Displaying the records
Preparing the reports