Friday, February 1, 2019

Gravity Fall

  • Problem Description

    Create a program that determines how quickly an object is traveling when it hits the ground. The user will enter the height from which the object is dropped in meters (m).

    Because the object is dropped its initial speed is 0m/s. Assume that the acceleration due to gravity is 9.8m/s. 

    vf =squareroot(vi+2ad) 

    You can use the formula given above to compute the final speed, vf , when the initial speed, vi , acceleration, a, and distance, d, are known
  • CODING ARENA
  • import math
    a=int(input())
    ans=math.sqrt(2*9.8*a)
    print("The object will hit the ground at",round(ans,2),"m/s")

  • Test Case 1

    Input (stdin)
    45
    
    
    Expected Output
    The object will hit the ground at 29.7 m/s
  • Test Case 2

    Input (stdin)
    148
    
    
    Expected Output
    The object will hit the ground at 53.86 m/s

No comments:

Post a Comment