2.2 programming Flashcards

(31 cards)

1
Q

count controlled loop`

A

for

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

condition controlled loop

A

while

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

MOD

A

returns the remainder

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

DIV

A

returns whole number

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

casting

A

convert 1 data type to another

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

string casting

A

str

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

integer casting

A

int

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

real casting

A

real()

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

boolean casting

A

bool()

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

float casting

A

float()

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

how to count characters in string

A

.length

variable = “hi”
variable.length -> 2

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

how to extract characters from a string

A

.substring(x,y)
x=start
y=amount of numbers

variable = “hello”
variable.substring(2,3) -> ell

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

how to extract characters from left

A

.left(x)
x=amount of numbers
variable.left(2)

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

how to extract characters from right

A

.right(x)
x=amount
variable.right(2)

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

how to convert a string to uppercase

A

variable.upper

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

how to convert a string to lowercase

A

variable.lower

17
Q

how find ascii value of a character

A

ASC(“x”)
x being a letter

18
Q

how find character value of an ascii value

A

CHR(x)
x being a number

19
Q

how to open file

A

variable = open(“text.txt”)

20
Q

how to read a line

A

data = variable.readLine()

21
Q

how to write a line

A

variable.writeLine(“new line added”)

22
Q

variable.endOfFile()

A

returns true if final line of variable has been reached

23
Q

how to close a file

A

variable.close

24
Q

how to create a text file

A

newFile(“text.txt”)

25
record
-collection of related data items for one entity -data structure that allows multiple structures to be stored -uses field names to identify each item of data -data stored in table
26
SQL
language used to access data stored in database
27
SELECT
-identifies fields to return from database -* is all fields
28
FROM
identifies which table data is returned from
29
WHERE
allows programmer to optionally add criteria, returning only matching records
30
procedures
subprogram that does not return a value
31
functions
subprogram that returns a single value