Exam-style question
Try this first
Which scenario most clearly requires a data structure to represent several related values?.
- A.Recording the temperatures for seven days
- B.Testing whether one switch is on
- C.Displaying one fixed heading
- D.Storing one person's age
Model answer
What a good answer should say
- Recording the temperatures for seven days
Explanation
Why this works
The temperatures for seven days form a collection of related values, so organising them in a data structure would be useful. The other scenarios each describe a single value.
Common mistake
No common mistake is linked to this question yet.
