Question: Provide a high-level decomposition. This should do no more than break the problem into the main subproblems. It is a description of what the solution
-
Provide a high-level decomposition. This should do no more than break the problem into the main subproblems. It is a description of what the solution needs to do, without going into the detail of how it will be done. As a rather fanciful example, if you were planning a mission to collect rock samples from the Moon a high-level decomposition could be
> Collect Moon rocks
>> Fly to Moon
>> Land
>> Collect rock samples
>> Return to Earth
As you see this leaves out all the detail of things like distances and velocities and just gives the big picture. Of course, your decompositions will be very different, but we hope the example gives a feel for the level of detail appropriate in a high-level decomposition.
- Say what the inputs and outputs of the problem are.
- Write two tests for the problem. Present the tests in a table, with a column for each input and output, and an extra column with a brief explanation of why you selected each test .
-
a.Convert a list of whole numbers representing distances in miles to a list of the corresponding distances in kilometres, rounded to 1 decimal place. You should use a conversion factor of 1.61 from miles to kilometres. The Python round function was introduced in 1.2.3 of Block 1 Part 1.
(9 marks)
-
b.Given a list of whole numbers, if there is a value or values that exceed 100 the result should be the last such value found in the list. If there is no value that exceeds 100 the result should be the special Python value None.
(9 marks)
(Total 18 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
