AI Paper 2 Flashcards

(63 cards)

1
Q

What does the Terminator symbol represent in a flowchart?

A

The ‘Start’ and ‘Stop’ of the process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the Process symbol represent in a flowchart?

A

Something being performed or done

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the Input/Output symbol represent in a flowchart?

A

The input or output of something into or out of the flowchart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Decision symbol represent in a flowchart?

A

A decision (Yes/No or True/False) resulting in two possible outcomes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the Subroutine symbol represent in a flowchart?

A

A subroutine call that relates to a separate, non-linked flowchart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the pseudocode for setting up a procedure to calculate area?

A

PROCEDURE calculate_area(length: INTEGER, width: INTEGER)
area ← length * width
OUTPUT “The area is “, area
END PROCEDURE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you call a procedure in pseudocode?

A

CALL calculate_area(5,3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the pseudocode for setting up a function to calculate area?

A

FUNCTION calculate_area(length: INTEGER, width: INTEGER)
area ← length * width
RETURN area
ENDFUNCTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you use a function in pseudocode?

A

OUTPUT(calculate_area(5,3))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the pseudocode for declaring a variable?

A

DECLARE Num: INTEGER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the pseudocode for declaring a constant?

A

CONSTANT Num: INTEGER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the pseudocode for an IF statement?

A

IF Answer ← “Yes” THEN
OUTPUT “Correct”
ELSE
OUTPUT “Incorrect”
ENDIF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the CASE statement do in pseudocode?

A

Filters actions based on input values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the pseudocode for a FOR loop?

A

FOR count ← 2 TO 10 STEP 2
OUTPUT “Hello!”
NEXT count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the pseudocode for a WHILE loop?

A

WHILE Colour != “Red” DO
INPUT Colour
ENDWHILE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the pseudocode for a REPEAT…UNTIL loop?

A

REPEAT
INPUT Colour
UNTIL Colour ← “Red”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the pseudocode for totalling?

A

FOR count ← 1 to 10
INPUT Num
TOTAL ← TOTAL + Num
NEXT count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the pseudocode for counting?

A

FOR index ← 1 to 10
INPUT Num
IF Num > 5 THEN
Count ← Count + 1
ENDIF
NEXT index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the pseudocode for string handling to find length?

A

String ← “Hello World!”
OUTPUT LENGTH(String)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the pseudocode for substring handling?

A

Words ← “Hello World!”
OUTPUT SUBSTRING(Words, 1, 3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the pseudocode for converting a string to uppercase?

A

String ← “Hello World!”
OUTPUT UCASE(String)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the pseudocode for converting a string to lowercase?

A

String ← “Hello World!”
OUTPUT LCASE(String)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What does the MOD function do?

A

Returns the remainder of a division

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does the DIV function do?

A

Returns the quotient of a division

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does the ROUND function do?
Returns a value rounded to a given number of decimal places
26
What does the RANDOM function do?
Returns a random number between 0 and 1
27
What is the pseudocode for declaring a 1D array?
DECLARE scores: ARRAY[0:4] OF INTEGER
28
What is the pseudocode for initializing a 1D array?
scores ← [12, 10, 5, 2, 8]
29
What is the pseudocode for assigning a value in a 1D array?
scores[3] ← 9
30
What is the pseudocode for declaring a 2D array?
DECLARE NamesAndNumbers : ARRAY[1:3, 1:3] OF STRING
31
What is the pseudocode for assigning values in a 2D array?
NamesAndNumbers[1,1] ← “John” NamesAndNumbers[2,1] ← 35
32
What is the pseudocode for opening a file?
OPENFILE "fruit.txt" FOR READ
33
What is the pseudocode for closing a file?
CLOSEFILE "fruit.txt"
34
What is the pseudocode for reading a line from a file?
READFILE "fruit.txt", LineOfText
35
What is the pseudocode for writing a line into a file?
WRITEFILE "fruit.txt", "Oranges"
36
What does the SELECT command do in SQL?
Retrieves data from a database table
37
What does the FROM command do in SQL?
Specifies the table(s) to retrieve data from
38
What does the WHERE command do in SQL?
Filters the data based on a specified condition
39
What does the ORDERBY command do in SQL?
How data is organised (sorted) when it is retrieved
40
What does the SUM command do in SQL?
Adds up and outputs the sum of a field
41
What does the COUNT command do in SQL?
Counts the number of files that match the criteria
42
What is the definition of Analysis?
A process that involves identification of the problem and its requirements
43
What is Abstraction?
The act of removing unimportant details from the problem
44
What is Decomposition?
The act of breaking down complex problems into manageable parts
45
What is the definition of Design?
Creating a design for the solution to a problem based on analysis
46
What is Coding?
A process that involves writing program code and iterative testing
47
What is Iterative testing?
Conducting modular tests, making code amendments if necessary
48
What is Testing?
Testing program code with a variety of test data
49
What is Validation?
An automated process where a computer checks if user input is sensible
50
What is Verification?
The act of checking data is accurate when entered into a system
51
What is Normal data?
Data that is within the acceptable range and should be accepted
52
What is Abnormal data?
Data that is not within the acceptable range or the wrong data type
53
What is Extreme data?
Data that exists at the upper and lower acceptable limits
54
What is Boundary (rejected) data?
Data that exists just beyond the upper and lower limits
55
What is a Local variable?
A variable that is defined within a specific subroutine (e.g. function/procedure) and is only accessible within that subroutine
56
What is a Global variable?
A variable that can be accessed and modified from any part of a program
57
What is a Primary key?
The key field that uniquely identifies each record
58
What are the arithmetic operators?
+, -, *, /, ^, MOD, DIV
59
What are the logical operators?
=, <, <=, >, >=, <>
60
What are the Boolean operators?
AND, OR, NOT
61
What are meaningful identifiers used for in programming?
To enable the programmer to easily recognise the purpose of a variable
62
What is the purpose of comments in code?
To annotate each section of a program for clarity
63
Why are procedures and functions used in programming?
To make programs modular and easier to update