Section 7 Flashcards

(21 cards)

1
Q

What are variables?

A

Any data that a program uses which is stored in memory locations, has its own identifier, and has values in locations which may change when running

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

What is an identifier?

A
  • Refers to location in memory where the data item is stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a data type?

A
  • Defines type of data that will be stored at the memory location and therefore the operations that can be performed on it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the data types?

A

integer - whole number
real/float - number with fractional part
char - single character (letter, digit, punctuation mark, symbol)
string - zero or more characters, can be null
boolean - value of true or false

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

How are values assigned to variables?

A

Using an = sign

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

What is casting?

A

Changing the type of variable value from one type to another

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

What is concatenation?

A

Joining two strings together with +

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

What type of length does an array have?

A

Fixed Length

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

What is an array?

A

Group of fata items of the same data type

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

What does each box in an array include?

A
  • Numerical reference called a subscript or index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a subroutine or sub-program?

A

Self- contained section of code that performs a specific task

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

What are the two types of subroutine?

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

How can you make a procedure more useful?

A

Pass it one or more parameters

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

What is a parameter?

A

Variable named in procedure heading that will receive and use whatever value you pass it

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

What is the main difference of a function compared to procedure?

A

Always return a value

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

What are variables declared or used in the main program called?

A

Global Variables

17
Q

What are advantages of subroutines?

A
  • Decompose large problem into small tasks
  • Tested
  • Used several times
  • Stored in library
  • Work at same time
  • Maintenance easier
18
Q

What is it called when we group data items together?

A
  • Data structure
  • Treated as a set of data
19
Q

Where can data be stored other than variable for permanent?

A
  • File
  • Held permanently on disk
  • Read next time needed
20
Q

What is the format for a SQL command?

A

SELECT
WHERE
FROM
ORDER BY