Lab1 BNR20803 Algorithm1 v1
Lab1 BNR20803 Algorithm1 v1
1/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
1.1. Understand the basic symbols of flow charts and method of pseudocode
1.2. Identify the Pseudocode and flow charts.
1.3. Create the Pseudocode and flow charts.
2. INTRODUCTION / THEORY
a. Terminal
The terminal symbol, as the name implies, is used to indicate the starting (BEGIN),
stopping
(END), and pause (HALT) in the program logic flow. It is the first symbol and the last
symbol in the program logic. In addition, if the program logic calls for a pause in the
program, that also is indicated with a terminal symbol. A pause is normally used in
the program logic under some error conditions or in case the forms had to be
changed in the computer’s line printer during the processing of that program.
b. Input/Output
Faculty of Engineering Technology Page No. 3/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
The input/output symbol is used to denote any function of an input/output device in the
program. If there is a program instruction to input data from a disk, tape, card reader,
terminal, or any other type of input device, that step will be indicated in the flowchart
with an input/output symbol. Similarly, all output instructions, whether it is output on a
printer, magnetic tape, magnetic disk, terminal screen, or any output device, are indicated
in the flowchart with an input/output symbol.
c. Processing
d. Flow lines
Flowlines with arrowheads are used to indicate the flow of operation, that is, the exact
sequence in which the instructions are to be executed. The normal flow of flowchart is from
top to bottom and left to right. Arrowheads are required only when the normal top to
bottom flow is not to be followed. However, as a good practice and in order to avoid
confusion, flow lines are usually drawn with an arrowhead at the point of entry to a symbol.
Good practice also dictates that flow lines should not cross each other and that such
intersections should be avoided whenever possible.
Faculty of Engineering Technology Page No. 4/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
e. Decision
The decision symbol is used in a flowchart to indicate a point at which a decision has to be
made and a branch to one of two or more alternative points is possible. Figure 1.2 shows
three different ways in which a decision symbol can be used. It may be noted from these
examples that the criterion for making the decision should be indicated clearly within the
decision box. Moreover, the condition upon which each of the possible exit paths will be
executed, should be identified and all the possible paths should be accounted for. During
execution, the appropriate path is followed depending upon the result of the decision.
f. Connector
If a flowchart becomes very long, the flow lines start crisscrossing at many places that
causes confusion and reduces the clarity of the flowchart. Moreover, there are instances
when a flowchart becomes too long to fit in a single page and the use of flow lines becomes
impossible. Thus, whenever a flowchart becomes too complex that the number and
direction of flow lines is confusing or it spreads over more than one page, it is useful to
utilize the connector symbol as a substitute for flow lines. This symbol represents an entry
from, or an exit to another part of the flowchart. A connector symbol is represented by a
circle and a letter or digit is placed within the circle to indicate the link. A pair of identically
labeled connector symbols is commonly used to indicate a continued flow when the use of
a line is confusing. So two connectors with identical labels serve the same function as a long
flow line. That is, they show an exit to some other chart section, or they indicate an entry
from another part of the chart. How is it possible to determine if a connector is used as an
entry or an exit point? It is very simple: if an arrow enters but does not leave a connector, it
Faculty of Engineering Technology Page No. 5/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
is an exit point and program control is transferred to the identically labeled connector that
does have an outlet. It may be noted that connectors do not represent any operation and
their use in a flowchart is only for the sake of convenience and clarity.
2.2. Pseudocode
Pseudocode is a language very close to English that allows us to represent a program concisely.
The only thing you need is a statement to show where you are starting and where you are
ending a program. We will be using the word Start for the start point and the word End to show
the finish point. Each program will contain statements to accomplish our goal; this will satisfy
step 3 from Chapter 1. Rules for Pseudocode are:
a. Write only one statement per line
b. Capitalize an initial keyword
c. Indent to show hierarchy
d. End multiline structures
e. Keep statements language independent
3. EQUIPMENT / REQUIREMENT
4. PROCEDURES (TASKS)
4.1. By Using a computer laboratory / handwriting, please create the pseudocode based on the
sentences below;
a) a program that can adding (total) and averaging (AVG) two number (X and Y) which are
received from input. Then, the total and average are displayed.
Begin:
1. input X,Y
2. total = X+Y
3. average (X+Y)/2
4. display total,average
End:
Faculty of Engineering Technology Page No. 6/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
b) a program that are able to measure or sense the car speed in miles per hour (mph), and then,
convert the speed in miles into kilometers per hour (km/h). The program also display the
speed in kmh. If the driver exceed the speed limit of 90kmh, program will warn the driver
through dislay with the message ‘PLEASE REDUCE SPEED’.
Start :
1. input mph
2. speed =mph
3. km/h =speed *1.609
4. if km/h >90 then
5. print ‘PLEASE REDUCE SPEED’
End :
4.2. Please convert the pseudocode in task 4.1 into the flowchart. Please use microsoft word or
handsketching to draw flowchart.
a)
Faculty of Engineering Technology Page No. 7/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
b)
Faculty of Engineering Technology Page No. 8/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
4.3. From the flowchart given, please convert into the pseudocode.
Start :
1. Read width (W),length (L)
2. Area,A = W*L
3. Print A
End :
5. RESULTS
Flowchart have a few symbol that indicate necessary operation in the flow chart.
Pseudocode is a language very close to English that allows us to represent a program
concisely.All you need is statement to show how you start and how you end your program.
Faculty of Engineering Technology Page No. 9/9
Revision
Department of Electrical Engineering Technology 1
No.
Effective
Title: Lab 1: Algorithm 17/10/2022
Date
7. QUESTIONS
Advantages Disadvantages
Easily to converted to an actual Hard to see the program flows
programing language
Easy to understand for beginner Don’t get picture of the design
8. CONCLUSION
Flowchart and pseudocode is a method to write program.We identify and create pseudocode and
flowchart.