0
0
Drone Programmingprogramming~10 mins

Agricultural spraying and monitoring in Drone Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the drone's spraying system.

Drone Programming
drone.[1]()
Drag options to blanks, or click blank then click option'
AstartSpraying
BstopSpraying
Chover
Dland
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stopSpraying' instead of 'startSpraying'.
Using 'hover' which only makes the drone stay in place.
Using 'land' which makes the drone land instead of spraying.
2fill in blank
medium

Complete the code to check the drone's battery level before spraying.

Drone Programming
if drone.getBatteryLevel() [1] 20:
    drone.returnToBase()
Drag options to blanks, or click blank then click option'
A==
B>
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which would return to base when battery is high.
Using '==' which only triggers at exactly 20%.
Using '>=' which triggers when battery is high or equal.
3fill in blank
hard

Fix the error in the code to correctly log the spray area coverage.

Drone Programming
coverage = drone.getSprayArea()
print('Coverage:', coverage[1]'%')
Drag options to blanks, or click blank then click option'
A,
B+
C*
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using ',' which separates arguments but does not concatenate.
Using '*' which causes a type error.
Using '-' which is invalid for strings.
4fill in blank
hard

Fill both blanks to create a dictionary of field zones with their spray status.

Drone Programming
zones_status = {zone: drone.[1](zone) for zone in field_zones if drone.[2](zone)}
Drag options to blanks, or click blank then click option'
AcheckSprayed
BisSprayed
CstartSpraying
DstopSpraying
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'startSpraying' or 'stopSpraying' which control spraying, not status.
Swapping the two methods causing logic errors.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of zones needing spraying with their moisture levels.

Drone Programming
zones_to_spray = {zone[1]: drone.[2](zone) for zone in field_zones if drone.[3](zone) < 30}
Drag options to blanks, or click blank then click option'
A.upper()
BgetMoistureLevel
D.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.lower()' instead of '.upper()' for keys.
Using different methods for moisture level causing errors.
Not filtering zones correctly by moisture.