Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lesson
What is a program?
Program is a set of instructions or rules that solve a problem which is coded or
written using a particular computer language or programming language.
We use programming language to communicate with the computer, which can be
understood by both the user and the computer.
There are many programming languages available and basically programming
language is falls into two categories: High-level language and low-level
language.
Programming language said to be lower when it is close to the machine language.
High-level language is more English like.
Notation in Logic
What is a notation?
Notation is a system of figures or symbols used in a specialized filed to
represent numbers, quantities or values.
Each different language like C, Pascal and Java have their own unique
symbols (called syntax)
Wrongly using the symbols may lead to an error called syntax error
Page 1 of 7
Lesson
Patterns of Logic
The basic pattern in a program consists of 3 parts:
Beginning
Setting counters and total to an initial value
Obtaining initial values from an operator/user
Nominating files to be processed
Middle: usually involve in using any program structure
Obtaining data items to be processed from an operator/user or
from a file
Accessing a series of elements in a table
Accumulating totals and counters
End
To produce output
To close the files that have been processed
Algorithm Constructions
Any program will involve 3 steps of logic process:
Input : to accept the value from an operation at a terminal, or through
an initial expression. Keywords used like READ, INPUT and ENTER
Process: to perform process like calculation.
Output: to produce the result out on the terminal. Keywords like
PRINT, DISPLAY or OUTPUT.
Page 2 of 7
Lesson
Page 3 of 7
Lesson
knowledge base.
For example, you must know what the case study is about? The knowledge
base cover in the case studies in order to find the resource.
3. Identify the alternative ways to solve the problem.
You might want to talk to other people to find other solutions than those you have
identified.
For example, you might have a discussion session with your classmates to identify
other ways of solving the problem of the case study or another resources needed in
completing the assignment.
4. Select the best way to solve the problem from the list of alternative solutions.
In this step, you need to identify and evaluate the pros and cons of each possible
solution before selecting the best one.
For example, from all the resources that have been gathered, identify the most
suitable one that relevant to the title of the case study.
5. List instructions that enable to solve problem using the selected solution.
List out the instructions in step-by-step using the selection solution to solve
problem.
For example, after identified the required resources, the instructions that may
needed is to analysis, study, summarize and make conclusion.
Lesson
Algorithm Constructions
Algorithm is a set of rules or instruction to solve a problem.
For example, construct an algorithm to fry an egg.
Issues in program writing and design
Page 5 of 7
Lesson
Computers are built to deal with algorithm solutions, which are often difficult
or very time-consuming for humans.
Solving a complicated calculus problem or alphabetizing 10,000 names is
easy task for computer but the problem of how to throw a ball or how to speak
English is not, which cannot solved in the steps that make computer can
understand.
The field of computers that deals with heuristic types of problems is called
artificial intelligence.
Artificial intelligence enables a computer to do things like build its own
knowledge bank and speak in a human language.
People will process most heuristic solutions and computers will process many
algorithm solutions.
Page 6 of 7
Lesson
Page 7 of 7