An automated flight system is programmed to control a drone navigating a sequence of waypoints represented as an array called route.
route array| Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| Content | 'R' | 'R' |
route array.destination).1, 2, or 3.
'R':
"Restricted airspace!" is displayed.0.pos = 0
destination = len(route) - 1
while pos < destination:
Extend the program from Figure 3 so that the flight system works as described in the rules in Figure 2.
When writing your program, you should assume:
route.'R' characters in route can vary.'R' characters in route can vary.'R' characters have already been initialized in the array.route array can be of any length greater than 1.You should use meaningful variable names and correct programming syntax in your answer.
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.