Programming Fundamentals Flashcards

1
Q

What is iteration

A

the repetition of statements in a computer program

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

What is selection

A

Which path a program is going to take

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

What sort of results will selection give

A

boolean results

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

give 2 examples of iteration

A

for loops

while loops

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

What is nesting

A

when a programming construct is included within another

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

what is a variable

A

A named memory address that stores a value

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

What is a constant

A

something that allows the value to be assigned a name

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

What is the difference between a global and local variable

A

global variable can be accessed and changed, local variables are confined to a loop or subprogram

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

what is casting? give an example

A

changing the data type of a variable

for example: str(24.5) returns “24.5”

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

list 4 ways of string manipulation

A

length
upper and lowercase
character position
concatenation

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

how do you open a file to read

A

file = openRead(“scores.txt”)

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

How do you write to a file

A

file.writeLine(scores[x])

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

list the 3 commands that can be used to retrieve data from a database

A

SELECT
FROM
WHERE

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

what does * stand for in SQL? What does it mean

A

wildcard, it means from all records

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

what can the LIKE command do?

A

find matches from an incomplete word

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

what is a procedure

A

a section of computer code that completes a task

17
Q

what is a function

A

a section of code that can be called by another part of the program- returns a single value

18
Q

give 2 advantages of subprograms

A
  • they are easier to write,test and debug

- it can be used repeatedly but only written once