Programming 2- module 8) Flashcards

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

What do data structures allow us to do?

A

Store multiple pieces of data used in programs.

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

In pseudocode, and in many programming languages, what are arrays indicated by?

A

[], as in ClassGroup = [Alex, Bailey, Krishna, Jamie, Riley].

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

What are the main data types?

A

Array.

Records.

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

What is an array?

A

Collection of something. Only 1 type of data can be stored in an array- if you want to mix, say, names and numbers you’d have to use a list. You only need to worry about 2 different types of array.

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

What is an example of an array?

A

Students in a class.

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

What are the 2 different types of array?

A

1-dimensional.

2-dimensional.

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

What is a record?

A

Single instance within an array (or database).

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

What is an example of a record?

A

A student’s info within a class database would be 1 record.

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

What is a record used for?

A

Holding different pieces of data about 1 item.

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

What could a two-dimensional array be used for?

A

Class timetable or book reviews by different students, so that each row is a different book, + each column is the review by a different student.

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

What is a record structure?

A

Template for data storage that will most effectively do whatever you need.

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

What are key fields uniquely attached to?

A

Each record.

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

Why will a two-dimensional array often include key fields?

A

So that if there were 2 people with the same name who read the same book we would know which one we were looking for, because the key field is different.

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

What would be an example of a key field?

A

In your school records, you will have a UPN, a Unique Pupil Number. This would be your key field, or primary key. Even if someone was born on the same day as you, with the same name and address, they couldn’t be mixed up with you.

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

What can you imagine a two-dimensional array as?

A

As a table, or a chess board.

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