Questions & Tests for

N7 Education Umbrella Syllabuses
Computer Science


About N7

Use N7 to quickly find high-quality questions by syllabus criteria and question type to easily compose targeted tests complete with detailed mark schemes. You can even add your own questions to the mix and share them with your community.

Learn more
Question Image
Land surveyors use geographic data to determine suitability of grazing land for cows. In this scenario, geographic data is kept in 2D arrays where each element corresponds to an area on the 3x6 (row x column) map grid above. A 2D array called SLOPE, shown below, holds slope data. SLOPE array element contains a number between 0 (inclusive) and 1 (exclusive), approximating the average gradient magnitude for each corresponding section of land.
+-----+-----+-----+-----+-----+-----+ | 0.6 | 0.5 | 0.7 | 0.5 | 0.4 | 0.6 | | 0.7 | 0.3 | 0.2 | 0.2 | 0.3 | 0.2 | | 0.4 | 0.3 | 0.2 | 0.1 | 0.5 | 0.6 | +-----+-----+-----+-----+-----+-----+
Another 2D array called GRASS, shown below, holds grass quality data. GRASS array elements contains a number between 0 and 10 inclusive, approximating the average grass quality of each corresponding section of land where 10 is the best quality.
+-----+-----+-----+-----+-----+-----+ | 9.5 | 8.2 | 8.1 | 9.3 | 7.5 | 8.8 | | 9.1 | 5.1 | 2.7 | 1.2 | 7.2 | 8.3 | | 7.6 | 8.4 | 7.1 | 6.9 | 7.4 | 9.1 | +-----+-----+-----+-----+-----+-----+
Cows do best on flat land with high quality grass. Experts have decided that suitable locations must have both a gradient which is less than 0.4 and a grass quality rating above 7.
(a).
With respect to the data in 2D arrays SLOPE and GRASS, state whether the map location [2,3] is referring to a suitable grazing area and justify your reasons.
[3]
(b).
Write a function in pseudocode called isSuitableArea(ROW, COLUMN) which accepts two arguments, a row index called ROW and column index called COLUMN, then returns a boolean indicating whether or not the area specified by ROW & COLUMN is suitable for cattle grazing.
[3]
(c).
Using isSuitableArea(ROW, COLUMN), write a function in pseudocode called isSuitableRegion() which returns a boolean indicating if the region described by SLOPE and GRASS data is overall suitable for grazing, that is, if more than 50% of the region’s 18 sections are considered suitable for grazing.
[5]
Extended Response11 MarksPremium
38 Uses129 Views2 Likes
N7 Education

Ready to dive in?Start for free today.