Unit 1 SDD - Implementation - Data Types & Structures Flashcards

1
Q

Why is it important to define data types in a program?

A

Data types tell the program what kind of data a variable will hold, ensuring correct storage and operations in RAM.

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

What are the main data types in programming?

A

Integer, Real, Character, String, and Boolean.

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

What does the INTEGER data type store? Give an example.

A

Stores whole numbers (positive or negative). Example: 17.

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

What does the REAL data type store? Give an example.

A

Stores numbers with decimal places (floating-point numbers). Example: 17.65.

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

What does the CHARACTER data type store? Give an example.

A

Stores a single letter, number, or symbol. Example: ‘$’.

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

What does the STRING data type store? Give an example.

A

Stores text or alphanumeric combinations (a group of characters). Example: ‘Bitesize’.

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

Why shouldn’t numbers used for calculations be stored as a STRING?

A

Because string data is treated as text and cannot be used directly in calculations. Instead, they should be stored as INTEGER or REAL.

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

What does the BOOLEAN data type store? Give an example.

A

Stores True or False values. Sometimes represented as 1 (true) and 0 (false).

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

What are the two types of data structures required for National 5?

A

Variables and 1D arrays.

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

Why are data structures important in programming?

A

They store user inputs and results from internal processes, making it possible to manage and manipulate data efficiently.

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

How does program analysis relate to data structures?

A

Almost every input or process identified in a program’s functional requirements needs a data structure to store data.

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

What is a data structure?

A

A data structure is a way of storing multiple values or items together in an organized manner.

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

Why is STRING considered both a data type and a data structure?

A

A STRING is an array of characters stored together in sequence, making it both a data type and a structured way of storing text.

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

How is the name ‘Anne’ stored as a STRING?

A

It is stored as an array of four characters: ‘A’, ‘n’, ‘n’, ‘e’.

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

What is an array?

A

An array is a data structure that allows multiple values to be stored in a list format under a single variable.

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

Give an example of an array declaration.

A

DECLARE firstName AS STRING INITIALLY [‘Cho’, ‘Eve’, ‘Joseph’, ‘Uzair’] - This stores four names in an array.

17
Q

What is a variable in programming?

A

A variable is a storage location in a computer’s memory for a single item of data.

18
Q

What is a good analogy for a variable?

A

A variable is like a box where you can store data and label it to know what’s inside.