Planetary Weight
EasyAcc. 93.7%
+20 XP 8
Gravity Lock
The starship's landing computer needs to calculate the local weight of cargo. Space gravity is constant at 9.8 m/s².
- Declare a
constvariable namedGand set it to 9.8. - Calculate weight by multiplying
massbyG. - Return the calculated weight as a number.
01EXAMPLE 1
Input
mass = 10Output
98Explanation: 10 * 9.8 = 98
Constraints
- Use a const variable for the gravity value.
- Numerical tolerance is handled by the platform.
FundamentalsMathConstants
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
mass10
Expected Output
98
Click RUN to test your solution