4.1.1 Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an integer ?

A

Negative or positive whole number

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

What is a Real (float) ?

A

Positive or negative number with a decimal/ fractional part

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

What is a boolean ?

A

Data type based on logic - one of only two values, True or False.

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

What is a char ?

A

Char refers to a single character. The character can be any letter, digit, or symbol.

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

What is a string ?

A

Array of characters

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

What is static data ?

A

A type of data structure where the size and the structure is fixed at the time of its creation

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

What is dynamic data ?

A

Data that is not fixed in size.
Extra memory is fetched from the heap as it is required and pointers ‘point’ to the location of the next item in the data structure in memory.

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

What is a variable ?

A

A container held in main memory that can hold an assigned piece of data

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

Assign the integer 99 to the variable num

A

int num = 99;

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

What is a condition controlled iteration (indefinite iteration) ?

A

A set of instructions is repeated based on whether a condition evaluates as true or false.

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

What is a count controlled iteration (definite) ?

A

A set of instructions is repeated a specific number of times.

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

What is an infinite iteration ?

A

A set of instructions that repeats and never terminates.

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

For loop syntax

A

for (initialiser (int i = 0) ; condition (i >,=,<…) ; iterator (i++))

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

foreach : items in an array / list

A

foreach( datatype name in array)

console.Write(name)

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

While loop syntax

A

While ( condition is true)
{
INSTRUCTIONS
}

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

Do while loop VS while loop

A

Do while checks whether the condition is true at the end of the loop instead of at the start.

17
Q

Do while syntax

A

do
{
INSTRUCTIONS
}
while (condition is true)

18
Q

What is a nested loop ?

A

Loop inside another loop.

19
Q

Switch statement syntax

A

Switch (variable or item)
case VALUE:
INSTRUCTIONS
break;
case VALUE2:
INSTRUCTIONS
break;
case VALUE3:
INSTRUCTIONS
break;

20
Q

If statement syntax

A

if (item == value)
{
instructions
}
else
{
Instructions
}

21
Q

What is a procedure ?

A

A procedure is a set of instructions that will be executed when the procedure is called

22
Q

What is a function ?

A

Procedure that returns a value.