0
0
Drone Programmingprogramming~20 mins

Barometer for altitude in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Barometer Altitude Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:30remaining
Calculate altitude from pressure reading
Given the barometric pressure reading in Pascals, what is the altitude in meters calculated by the formula?

Altitude = 44330 * (1 - (pressure / 101325)^(1/5.255))

What is the output of this code snippet?
Drone Programming
pressure = 90000
altitude = 44330 * (1 - (pressure / 101325) ** (1/5.255))
print(round(altitude))
A1000
B1115
C900
D1200
Attempts:
2 left
💡 Hint
Use the formula carefully and round the result to the nearest integer.
🧠 Conceptual
intermediate
1:30remaining
Understanding barometer altitude calculation assumptions
Which assumption is NOT true when using a barometer to calculate altitude from pressure?
ATemperature is constant in the air column
BPressure decreases exponentially with altitude
CHumidity has no effect on pressure readings
DSea level pressure is known and constant
Attempts:
2 left
💡 Hint
Think about what environmental factors affect air pressure.
🔧 Debug
advanced
2:00remaining
Fix the altitude calculation code with wrong operator
This code is intended to calculate altitude from pressure but produces a wrong result. What is the error?
Drone Programming
pressure = 85000
altitude = 44330 * (1 - pressure / 101325) ** (1/5.255)
print(round(altitude))
AThe pressure value is too low, causing negative altitude
BThe print statement is missing parentheses
CThe formula uses addition instead of subtraction
DThe exponentiation applies only to the division, not the whole expression; parentheses are missing
Attempts:
2 left
💡 Hint
Check operator precedence and grouping in the formula.
📝 Syntax
advanced
1:30remaining
Identify the syntax error in altitude calculation snippet
Which option contains a syntax error that prevents the altitude calculation code from running?
Drone Programming
pressure = 95000
altitude = 44330 * (1 - (pressure / 101325) ** (1/5.255))
print(round(altitude))
Aaltitude = 44330 * (1 - (pressure / 101325) ** 1/5.255)
Baltitude = 44330 * (1 - (pressure / 101325) ** (1/5.255))
C))552.5/1( ** )523101 / erusserp( - 1( * 03344 = edutitla
Daltitude = 44330 * (1 - (pressure / 101325) ** (1//5.255))
Attempts:
2 left
💡 Hint
Look carefully at operator precedence and parentheses.
🚀 Application
expert
2:30remaining
Calculate altitude difference from two pressure readings
You have two pressure readings from a drone's barometer at two different points:
Pressure1 = 101325 Pa (sea level)
Pressure2 = 90000 Pa (higher altitude)

Using the formula:
Altitude = 44330 * (1 - (pressure / 101325)^(1/5.255))

What is the altitude difference between the two points?
A1115 meters
B0 meters
C900 meters
D1500 meters
Attempts:
2 left
💡 Hint
Calculate altitude for each pressure then subtract.