Students are provided a scenario with four parallel arrays where each array stores the air pressure of a car tyre (front left, back right etc).
Each question asks students to write code to solve a stated problem. Answers require that students write:
- find maximum - code that finds the largest value in an array
- find minimum - code that finds the smallest value in an array
- linear search - code that traverses an array looking for values
- count occurrence - code that count the number of times values are found in an array.
The questions get progressively harder.
Although many programming languages contain functions to carry out some or all of the above, knowing how to code these algorithms aids code understanding and gives students the ability to write alternative versions of each algorithm.
Marking Instructions and a completed Python program with the solutions are supplied.
The questions are suitable for any programming language your students may be familiar with. The marking instructions could be adapted for solutions in different languages.
These could also be turned into practical tasks by providing a partial program that sets up the data in the arrays.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.