Pseudocode Flashcards
Description of NOT gate
triangle with circle in front
WHERE in SQL
query/condition of data to be displayed
COUNT in SQL (2)
counts number of records where field matches condition
used with SELECT
RANDOM() Library routine
returns a random number between 0 and 1
SUM in SQL (2)
sum of all values in field
used with SELECT
Components of decomposition in analysis stage (4)
input - what is put into system
processes - action taken to achieve result
output - what is taken out of system
storage - what needs to be kept in for future use
NAND gate rule
if both input = 1, then output = 0
Case Statement Structure (4)
CASE OF “Name”
1:
2:
OTHERWISE OUTPUT
ENDCASE
ROUND library routine (2)
returns value rounded to specified number of decimal places
rounded to highest or lowest value
Validation check meaning (2)
checks that data input is reasonable + meets certain criteria
automated check carried out by computer
Bubble Sort (8)
Swap <– False
REPEAT
if variable 1 > variable 2
then var <– variable 1
variable 1 <– variable 2
variable 2 <– var
Swap <– True
UNTIL Swap = True
Range check
checks that data is within certain range
Coding of Program Development Life Cycle (2)
uses design from previous stage
written using IDE
Function structure with parameters (3)
FUNCTION Name (variable : type) RETURNS type
RETURN (“action”)
ENDFUNCTION
OR gate rule
output = 1 if either input = 1
ORDER BY in SQL
sorts results numerically or alphabetically
Extreme Data
largest and smallest data that algorithm should allow
Procedure with parameters structure (6)
PROCEDURE Stars (Number : INTEGER)
DECLARE Counter : INTEGER
FOR Counter –> 1 to Number
OUTPUT “*”
NEXT Counter
ENDPROCEDURE
CALL Stars(7) //outputs 7 *
Design of Program Development Life Cycle (3)
visually representing program before coding
will help to explain how code works
e.g flowchart
MOD
remainder of division
Type check
checks that data entered is correct type (e.g integer, string)
Substrings code (2)
SUBSTRING(STRING, position of start character, length of substring)
string starts at position 1
Description of AND gate
curved rectangle
Description of NOR gate
arrowhead with circle in front
Analysis of Program Development Life Cycle (4)
understand what program will do
abstraction - obtain required input/output information
decomposition - breaking the program down into steps
indentifying requirements - conditions to be carried out to get final outcome
Define format check
checks that input provided has valid formatting (e.g margins, font)
File Handling Structure using WRITE (3)
OPENFILE “file name” FOR WRITE
WRITEFILE “filename”, variable
CLOSEFILE “filename”
FROM in SQL
indentifies table to use
Length check
checks that number of characters is correct
Testing of Program Development Life Cycle
ensuring that program works as it should
Verification check meaning
checks that data is not changed as it is entered from one source to another
DIV library routine (2)
performs integer division
answer is whole number
Boundary data
data at the limit and data one value beyond (error)
Examples of Design in program development cycle (3)
flowchart
pseudocode
structure diagram
Declaring a 2D array
DECLARE Name : Array[number:number] of integer
Order of the Program Development Life Cycle (4)
Analysis
Design
Coding
Testing
File Handling Structure using READ (3)
OPENFILE “file name” FOR READ
READFILE “filename”, variable
CLOSEFILE “file name”
XOR gate rule
output = 1 if input A is 1 AND input B is 0 OR input A is 0 AND input B is 1
AND gate rule
output = 1 if both inputs = 1
2 types of verification check (2)
double-entry check - data is entered twice to check that no changes are made
visual check - user looks through data entered + confirms no changes have been made
MOD library routine
returns remainder of division
Record in grid
horizontal rows
Description of NAND gate
curved rectangle with circle in front
Validation checks (6)
Length check
Range check
type check
check digit
Prescence check
format check
Define abstraction (3)
simplifying the problem
selecting elements required
removing irrelevent data from elements
Define prescence check
checks if user has entered data
NOR gate rule
output = 1 if neither inputA OR B = 1
NOT gate rule
output = 1 if input = 0
Field in grid
vertical collumns
How program can be written to make it presentable + maintained (4)
use comments to explain purpose of code
use meaningful identifier names - clearly identify purpose
use procedures + functions - shortens code
indentation + space - more readable
Description of OR gate
arrowhead
SELECT in SQL
fetches specified fields from table
Normal Data
data within the algorithm range
SQL structure (4)
SELECT
FROM
WHERE
ORDER BY field ASC or DSC;
Procedure without parameters structure (4)
PROCEDURE Name
OUTPUT “action”
ENDPROCEDURE
CALL Name
Description of XOR gate
arrowhead with line behind
Abnormal/Erroneous Data
data rejected by algorithm
Linear Search (9)
Found <– False
REPEAT
IF Name = Student[Count]
THEN
Found <– True
ELSE
Count <– Count + 1
UNTIL Found = True OR Count > ClassSize