Please enable JavaScript.
Coggle requires JavaScript to display documents.
Ch.22 Algorithm Design (I) - Coggle Diagram
Ch.22 Algorithm Design (I)
22.1 Introduction to Algorithm Design
An algorithm
A finite sequence of steps arranged in specific logical order to generate a solution to a problem
Pseudocode
describe an algorithm in narrative form
Flowcharts
represent an algorithm in graphical form
Flowcharts use a set of commonly used symbols to represent various kinds of operations in solving a problem.
22.2 Identifying Inputs and Outputs of a Problem
usually shown in an IPO chart
Input and output requirements of a problem
Designing an appropriate user interface
appropriate use of colours
consistent alignment of fields
concise and appropriate use of wording
appropriate use of control objects
Consistency in a user interface
Different versions for different types of users
Fixed path of navigation from one form to another within an interface
Appropriate placement of different elements on a user interface
Form field validation
22.3 Basics of Constants and Variables in Computer Programming
Constant
a value that cannot be changed during the execution of a program
Variable
a value that may change as a program runs
Simple data types
Integer (Numeric)
Real (Numeric)
Boolean
Contain two possible values only
TRUE
FALSE
Character
String
a collection of characters
One-dimensional array
collection of variables of the same data type and each variable is associated with an index number
Truth table
AND operator
Contain one FALSE then FALSE
OR operator
Contain one TRUE then TRUE
22.4 Selection of Appropriate Data Types
Most data belongs to one of these three types
Character
Logical
Numeric
Numbers which are normally not involved in calculations, should not be assigned to be numeric data
In general, we do not use string data for calculations.
Name, account number, address, and telephone number are string data
Logical data is for making ‘Yes or No’ or ‘True or False’ decisions