Ch. 12 computer Science

int, char, float, double, and boolean are all "simple" data types.

true

Any data type that can store more than one value is a data structure.

true

A data structure is a data type whose components are smaller data structures and/or simple data types.

true

The first historical data structure is a file.

false

A record is frequently also called a vector.

false

A record is a data structure with one, or more, elements, called fields, of the same or different data types.

true

An array is a data structure with one of more elements of the same or different data types.

false

A file is an external structure with a specified number of elements assigned to an internal file name.

false

The file data structure allows transfer of data between internal and external storage.

true

Records, arrays, and files are all data structures.

true

A stack is a data structure with one of more elements of the same data type.

true

In a stack, all elements are accessed directly.

false

In an array, elements can only be accessed in a LIFO (Last In First Out) manner.

false

A data structure is any data type that stores...

more than one value.

Which is the first historical data structure?

array

The language FORTRAN introduced the...

array

The language COBOL introduced the...

record

What data type is the array index?

integer

What is the index value of the first array element?

0

The record is a data structure that stores...

elements of the same or different data types

The file is a data structure that...

handles storing data to an external file name.

The stack is a data structure that accesses data...

like a LIFO.

In the improved data structure definition what was added to more precisely define a data structure?

the storing and retrieval of data

Write an array declaration for an array named scores, which can store 100 integers.

int scores[] = new int[100];

Write an array declaration, numerals, which stores {'0','1','2','3','4','5','6','7','8','9'}.

char numerals [] = {'0','1','2','3','4','5','6','7','8','9'};

The keyword length indicates...

the number of elements in an array.

A data type whose components are smaller data structures and/or simple data types.

data structure

A data type that only stores a single value.

primitive/simple

Another word for an array.

subscripted variable

Another word for a one-dimensional array.

vector

Another word for a two-dimensional array.

matrix

A data structure with one, or more, elements, called fields, of the same or different types.

record

The index of the first element of an array.

0

The index of the last element of an array.

length - 1

Will tell you how many elements are in an array.

length

If an array of ____ is defined, but the individual elements are not initialized, 0 will be the default value of all the elements.

int

If Java did not have a String data type, the closest substitute would be an array of ____.

char

Similar to an array, but can only access data in a LIFO manner.

stack

An internal data structure assigned to an external file name.

file

Regardless of what an array stores, the index is always this data type.

int

Programming language that introduced arrays.

FORTRAN

Programming language that introduced records.

COBOL

The largest valid index of an array.

length - 1

The smallest valid index of an array.

0