Chapter 3 Data Types and Structures Flashcards

1
Q

What is a data type?

A

A data type is the type of data that is used in the program. The way in which the data is manipulated will depend on the data type.

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

What is declared at the start of the program alongside a variable?

A

An identifier and a data type.

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

What are the 3 main data types?

A

Numeric, alpha-numeric and boolean.

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

What two types of numeric data types are there?

A

Integer and Real.

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

What two types of alpha-numeric data types are there?

A

String and Character

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

What kind of answer does a boolean have?

A

TRUE/FALSE or YES/NO

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

What kind of numbers can an integer be?

A

Whole

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

Can a real value have a decimal value?

A

Yes

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

What does a boolean do?

A

It can only have two values and is often used to see if a condition has occurred or a value has been met.

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

How many digits does a character normally have?

A

One

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

Which data type is used for longer pieces of text?

A

A String

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

What are the two data structures?

A

Arrays and Records.

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

What is an Array?

A

An array is a piece of data that contains several pieces of similar data.

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

What is meant by an element of an array?

A

Elements of an array are pieces of data with the same data type, similar memory size and are usually stored next to each other.

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

What orders the elements?

A

The index.

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

What are the bounds of the index?

A

The highest and lowest values.

17
Q

Why does using an array help when declaring the data?

A

You can declare all the statements using the array by using one statement.

18
Q

What is a record?

A

A record is used to store several data types under one identifier.

19
Q

What is the name given to individual values in a record?

A

A field.

20
Q

In which file types will removing a piece of data leave a gap?

A

Serial, Sequential and Indexed Sequential.

21
Q

What is the difference between a sequential file and an indexed sequential file?

A

An indexed sequential file has a index.

22
Q

What is the formula for finding a record in a direct access file?

A

Address of record number (n)=Beginning of file + (n-1) * size of record.

23
Q

What are the 4 steps in estimating a file size?

A
  1. Work out the size of each field in the record in bytes.
  2. Add field sizes together to get the size of one record.
  3. Multiply the size of one record by the number of records in the file.
  4. Add 10% to accommodate for the extra storage needed to manage the file.
24
Q

How do you change from bytes to kilobytes?

A

Divide by 1000.

25
Q

Why don’t you divide by 1024?

A

Because it is only an estimate.