Programming (Paper 2) Flashcards

(52 cards)

1
Q

What are the data types?

A

-INTEGER
-REAL
-CHAR
-STRING
-BOOLEAN

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

What is a variable?

A

A data item held in memory which may change value during the program execution

-It is referred to by its identifier

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

What is an INTEGER?

A

A whole number

Example = 5,10,57,18

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

What is REAL?

A

A number with a decimal point

Example = 1.4, 3.15, 56.0

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

What is CHAR?

A

A single character enclosed in single quotes

Example = ‘A’, ‘+’, ‘1’, ‘@’

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

What is STRING?

A

Zero or more characters enclosed in double quotes

Example = “Yes”, “Hello”, “Marcus”

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

What is BOOLEAN?

A

The logical values TRUE or FALSE

Example = TRUE, FALSE

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

What is a constant?

A

A value that cannot change during the execution of the program

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

How would you write an input output statement in pseudocode?

A

OUTPUT “….”
INPUT ….

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

What are the arithmetic operators and what do they mean?

A

+ = addition

minus symbol = subtraction

/ = division

astrix = multiplication

^ = to the power of

MOD = remainder

=DIV = Quotient

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

What are the logical operators and what do they mean?

A

= = equals

<= less than

<= = less than or equal to

> = greater than

=> = greater than or equal to

<> = not equal to

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

What is a sequence statement?

A

Two or more statements written and executed one after the other in sequence

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

What is a selection statement?

A

A selection statement comprises an IF or CASE statement and a logical expression

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

What do selection statements contain?

A

IF
THEN
ENDIF
IF
THEN
ELSE
ENDIF

or

CASE OF
OTHERWISE
ENDCASE

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

Write a nested if statement

A

Check textbook

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

Write a case statement

A

Check textbook

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

What is an iteration statement?

A

Iteration means repetition and iteration statements comprise of FOR loops or Count controlled loops

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

Write a count controlled loop

A

Check textbook

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

Write a for (count) loop

A

Check textbook

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

Write a NESTED for loop

A

Check textbook

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

What are examples of condition controlled loops?

A

WHILE
DO
ENDWHILE

or

REPEAT UNTIL

22
Q

Write a while loop

A

Check textbook

23
Q

Write a repeat until loop

A

Check textbook

24
Q

What are examples of string operations?

A

LENGTH()
LCASE()
UCASE()
SUBSTRING()

25
Write an example of a length operation
Check textbook
26
What will a length operation return?
The number of letters in a string (Including spaces)
27
What will the LCASE operation return?
The string in all lowercase letters
28
What will the UCASE operation return?
The string in all uppercase letters
29
What will the SUBSTRING operation return?
The letters from certain values (Check textbook if unsure)
30
Write a procedure
Check textbook
31
What is a procedure?
A procedure is a named block of code separate from the main program which can be called and executed
32
What is a function?
Another type of subroutine It returns a value specified in the statement which calls it
33
Write a procedure
Check textbook
34
Write a function
Check textbook
35
Write a min algorithm
Check textbook
36
Write a totaling algorithm
Check textbook
37
Write a max algorithm
Check textbook
38
What is a local variable?
One that is ONLY contained in a procedure and cannot be accessed in the main program
39
What is a global variable?
One that is used in the main program
40
What are things you must do when creating a program?
-Use sensible identifiers -ADD COMMENTS
41
Write an array
Check textbook
42
Write a 2D array?
Check textbook
43
What is a record in a text file?
The lines (rows)
44
What is a field in a text file?
The text (columns)
45
Write a program that opens, writes and reads a textfile
Check textbook
46
Write a program that opens, writes and closes a textfile
Check textbook
47
Write a min algorithm
Check textbook
48
Write a max algorithm
Check textbook
49
Write totaling code
Check textbook
50
Write averaging code
Check textbook
51
Write a procedure to validate data
Check textbook
52
Write a procedure to allow the user to input values into an array
Check textbook