Guide | Statement

Statement

Sets apart the question that closes a long activity description, so that what is being asked is unmistakable.

It displays as follows:

 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut porta, neque id feugiat consectetur?

 

Use cases

Is discouraged…

  • To place it at the start of the text explaining the activity, as it works as the conclusion the description leads to.
  • To use it several times in one activity.

Examples

Example 1

Final practical: reading a file of marks

To close the unit you will work with real data. You are given a text file with the marks of three groups, one per line, in the format group, student and mark, separated by commas. The file has deliberate errors in it: incomplete lines, marks out of range and the odd extra separator.

You have to write a program that reads the file, discards the lines it cannot parse while recording how many it discarded, and then works out the average of each group. It must run from the command line with the file as an argument, and it must have tests for the edge cases.

 

Bearing in mind what we have seen about immutable types and about error handling, which data structure would you use to accumulate each group's marks, and where in the program would you deal with the faulty lines?

 

Example 2

Close reading

Read the opening three pages of the chapter again, this time paying attention to what the narrator chooses to leave out. Note down every place where the account of events depends on something the narrator could not have witnessed.

 

With all of that in mind, what would you change in the opening scene so that the narrator stops being reliable?