Fixed Formulas
EasyAcc. 93.7%
+20 XP 8
Unchanging Rules
Some rules in nature or business never change, like gravity or conversion rates. In programming, we declare these fixed values using const so they cannot be altered accidentally by other code.
The Assignment
Your task is to find the object's weight on Earth using the mass provided.
- Declare a
constvariable namedGand set it safely to 9.8. - Multiply
massbyGto find the weight. - Return the calculated weight.
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...
5 Hidden
Input Arguments
mass10
Expected Output
98
Click RUN to test your solution