3.2 - programming Flashcards

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

downsides of constants?

A

if value must be changed, must change value in all instances of it in program

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

difference between indefinite and definite iteration?

A

indefinite = loop until condition met

definite = terminates after known amount of steps

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

what is 15 mod 2

A

1 (remainder)

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

what is 15 div 2

A

7 (integer division)

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

sign of not equal to?

A

equal sign with cross diagonal

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

command to select a particular character in a string?

A

POSITION(variable name, place)

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

what is the command to select a particular part of a string?

A

SUBSTRING (variable name, begin character, end character)

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

what is command to give number of characters in a string?

A

LEN (variable name)

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

another word for data structures?

A

abstract data types

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

what is an array?

A

a data store designed to store a set of data that is all of the same data type

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

first step of writing an array?

A

declare name and how big you want it to be

ie.
array ClassList [5]

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

how would writing an element in an array look?

A

ClassList [0]

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

can 2D arrays have different data types?

A

no, each element must have same data type

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

what would [3,1] and [0,2] be in the following array?

 0     1     2    3    4  0  30  35  32  25  22 1   29  21  29  25  28 2  27  23  32  26  19
A

25, 27

left then right

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

what is a record?

A

an element in a table made up from a collection of different data types

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

what kind of loop is an increment needed?

A

in a while loop, not a for loop

17
Q

what is a parameter?

A

a variable used to pass data into a subroutine

18
Q

positives of subroutines?

A
  • more understandable programs

- less chance of making errors

19
Q

difference between function and procedure?

A

function returns values, procedures do not

20
Q

how do you store the output of a function?

A

assign variable to call function

FUNCTION greet( )

name1