Sapient
Company
Programming
What will be the output of the following code?
public void onSensorChanged(SensorEvent event){
final float alpha = 0.8;
}
gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];
gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];
gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];
linear_acceleration[0] = event.values[0] - gravity[0];
linear_acceleration[1] = event.values[1] - gravity[1];
line
1) Runs successfully
2) Compile time error
3) Runtime error
4) None of the above
Read Solution (Total 0)
Sapient Other Question