Chapter One - Introduction - All Parts
Chapter One - Introduction - All Parts
Start course;
Start chapter;
{
Chapter One→ Introduction;
▪ Assembly language instructions and their translation into zeros and ones differ from machine
to machine.
▪ machine language programming was simply too slow tedious for most programmers.
▪ Any Assembly language program must be translated into machine language (by a program
called an assembler) before the computer can understand and execute the program.
▪ Both compiler and interpreters do the same job which is converting higher level
programming language to machine code.
▪ However, a compiler will convert the code into machine code (create an exe) before
program run.
▪ Interpreters convert code into machine code when the program is run.
▪ Some programming languages are designed to follow only one paradigm, while others
support multiple paradigms
▪ Any given procedure might be called at any point during a program's execution,
including by other procedures or itself.
▪ An algorithm is defined as a step-by-step sequence of instructions that must terminate and describe
how the data is to be processed to produce the desired outputs.
▪ Definiteness: Each step must be clearly defined, having one and only one
interpretation. At each point in computation, one should be able to tell exactly what
happens next.
▪ Sequence: Each step must have a unique defined preceding and succeeding step. The
first step (start step) and last step (halt step) must be clearly noted.
▪ Correctness: It must compute correct answer for all possible legal inputs.
June 7, 2024 By Kibru G. 32
Cont.
▪ Completeness: It must solve the problem completely.
▪ Efficiency: It must solve with the least amount of computational resources such
as time and space.
▪ The flowchart is a diagram which visually presents the flow of data through processing
system.
▪ This means by seeing a flow chart one can know the operations performed and
the sequence of these operations in a system.
▪ Flow chart is a blueprint of a design you have made for solving a problem.
False True
Light Slow
Yellow? Down
False
45
Pseudocode
▪ Is an artificial and informal language that helps programmers develop
algorithms.
Advantages of Pseudocode
▪ Reduced complexity.
▪ Increased flexibility.
▪ Ease of understanding.
▪ The difference between algorithm and pseudocode is that an algorithm is a step-by-step procedure
developed to solve a problem, while a pseudocode is a technique of developing an algorithm.
June 7, 2024 By Kibru G. 47
How to Write Pseudocode Statements?
There are six basic computer operations:
1. A computer can receive information: When a computer is required to receive information or input from a particular
source, whether it be a terminal, a disk or any other device, the verbs Read, Input and Get are used in Pseudocode. Read
is usually used when the algorithm is to receive input from a record on a file, while Get, Input are used when the
algorithm is used to receive input from the keyboard. For example, typical Pseudocode instructions to receive
information are:
Read student name
Get system date
Read number-1, number-2
Get tax-code
Input marks
Each example uses a single verb, Read or Get followed by one or more nouns to indicate what
data is to be obtained. At no stage is necessary to specify the source of the data, as this
information is not required until run time.
6. A computer can repeat a group of actions: When there is a sequence of processing tips, which
need to be repeated, two special keywords, DO WHILE and END DO are used in Pseudocode. The
condition for the repetition of a group of actions is established in the Do While clause, and the
actions to be repeated are listed beneath it. For example:
DO WHILE student-total < 50
Add 1 to student-total
END DO