Section Five - Programming Flashcards

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?

A

x.lower

25
Q

What does the function x.length do?

A

Returns the number of characters in string x.

26
Q

What function extracts the character in position i from string x?

A

x[i]

27
Q

What does the function x.subString(a,b) do?

A

Extracts a string starting at position a with length b from string x

28
Q

What structure do IF statements usually follow?

A

IF-THEN-ELSE

29
Q

What do IF statements allow you to do?

A

Check if a condition is true or false and carry out different actions depending on the outcome

30
Q

What do IF-ELSEIF statements allow you to do?

A

Check multiple conditions.

31
Q

Finish the Sentence:

FOR loops are an example of…

A

…a Count-Controlled Loop.

32
Q

Finish the Sentence:

SWITCH-CASE statements check the…

A

…value of a Variable

33
Q

What are loops controlled by?

A

Conditions

34
Q

/What are the three types of loops

A

Repeat loops
While loops
Do while loops

35
Q

What are three Boolean operators?

A

AND
OR
NOT

36
Q

Where can Boolean operators be used?

A

In conditions

37
Q

What are Arrays used for?

A

To store multiple data values

38
Q

What is each piece of data in an array called?

A

An element

39
Q

How can elements be accessed in an array?

A

By using its position/index in the array

40
Q

True or False?

One-dimensional arrays are like lists.

A

True

41
Q

What are you allowed to do when you open a file in READ mode?

A

Read data from the file into your program

42
Q

What do Databases do?

A

Organise data into fields and records

43
Q

What are Databases managed by?

A

SQL - standard query language

44
Q

What are the two most important keywords in SQL?

A

SELECT and FROM

45
Q

What is the purpose of WHERE in SQL statements?

A

To filter the results

46
Q

What are Procedures?

A

Sets of instructions stored under one name

47
Q

What are Functions?

A

Sets of instructions that always return a value

48
Q

True or False?

Global Variables can only be used within the structure they’re declared in.

A

False.

Global Variables can be used any time after their declaration.

49
Q

True or False?

Local Variables can be used any time after their declaration.

A

False

Local Variables can only be used within the structure they’re declared in.