If a drone moves up, 15 is added to its altitude. If the drone moves down, 15 is subtracted from its altitude.
The altitude of the drone must only be between 5 and 300 inclusive.
The function adjustAltitude():
Complete the function adjustAltitude()
function adjustAltitude(direction, altitude)
41 exam-style questions on OCR GCSE Computer Science Designing, creating and refining algorithms. Each one has a worked solution and a mark scheme showing where the marks go.