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
Answer and explanation
Concise answer
Recording the temperatures for seven days
Why this is correct
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.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
