Section Five - Programming Flashcards

(49 cards)

1
Q

True or False?

Programming languages have SIX main data types.

A

False

Programming languages have FIVE main data types.

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

Name the main data types:

A
Integer
Real (or float)
Boolean
Character 
String
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the characteristic of an integer?

A

Whole numbers only

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

What is the characteristic of a real/float?

A

Numbers that have a decimal part

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

What is the characteristic of a boolean?

A

Can only take one of two values, usually TRUE or FALSE

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

What is the characteristic of a character?

A

A single letter, number, symbol.

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

What is the characteristic of a string?

A

Used to represent text, it is a collection of characters

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

How much memory does an INTEGER typically take up?

A

2 or 4 bytes

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

What data type typically takes up 4 or 8 bytes?

A

Real

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

How much memory does a BOOLEAN typically take up?

A

1 bit is needed but 1 byte is actually used

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

What data type typically takes up 1 byte?

A

Character

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

How much memory does a STRING typically take up?

A

1 byte for every character in the string

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

What is used to change data types?

A

Casting

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

What does the operator ‘==’ mean?

A

Equal to

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

What symbol means ‘not equal to’?

A

!=

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

What does the operator ‘<=’ mean?

A

smaller than or equal to

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

What is the operator ‘=’ used for?

A

Is used to assign values to constants or variables

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

What is a constant?

A

An assigned data value that CAN’T be changed while the program is running

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

What is a variable?

A

An assigned data value that CAN be changed while the program is running

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

What is a string written inside?

A

Quotation marks

21
Q

What is concatenation?

A

Joining strings together to form new strings.

22
Q

How are the characters in a string numbered?

A

They are numbered numerically, starting at 0.

23
Q

What does the function x.upper do?

A

Changes all characters in string x to upper case

24
Q

What function would turn all the characters in string x to lower case?

25
What does the function x.length do?
Returns the number of characters in string x.
26
What function extracts the character in position i from string x?
x[i]
27
What does the function x.subString(a,b) do?
Extracts a string starting at position a with length b from string x
28
What structure do IF statements usually follow?
IF-THEN-ELSE
29
What do IF statements allow you to do?
Check if a condition is true or false and carry out different actions depending on the outcome
30
What do IF-ELSEIF statements allow you to do?
Check multiple conditions.
31
Finish the Sentence: | FOR loops are an example of...
...a Count-Controlled Loop.
32
Finish the Sentence: | SWITCH-CASE statements check the...
...value of a Variable
33
What are loops controlled by?
Conditions
34
/What are the three types of loops
Repeat loops While loops Do while loops
35
What are three Boolean operators?
AND OR NOT
36
Where can Boolean operators be used?
In conditions
37
What are Arrays used for?
To store multiple data values
38
What is each piece of data in an array called?
An element
39
How can elements be accessed in an array?
By using its position/index in the array
40
True or False? | One-dimensional arrays are like lists.
True
41
What are you allowed to do when you open a file in READ mode?
Read data from the file into your program
42
What do Databases do?
Organise data into fields and records
43
What are Databases managed by?
SQL - standard query language
44
What are the two most important keywords in SQL?
SELECT and FROM
45
What is the purpose of WHERE in SQL statements?
To filter the results
46
What are Procedures?
Sets of instructions stored under one name
47
What are Functions?
Sets of instructions that always return a value
48
True or False? | Global Variables can only be used within the structure they're declared in.
False. | Global Variables can be used any time after their declaration.
49
True or False? | Local Variables can be used any time after their declaration.
False | Local Variables can only be used within the structure they're declared in.