Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, we need to write a python code for this function. Thank you! Task 3: The Mai

ID: 640634 • Letter: H

Question

Hi, we need to write a python code for this function. Thank you!

Task 3: The Main Now, you need to "glue" together all you did in Task 1 and Task 2 . You have to write your main function. It must get d1, d2, h and a from the user. After that, it must the call horizontalHit and rampHit functions, passing the parameters needed Remember that the functions of Python math library that operate on angles use the radian as the angle measure. Hence you need to convert angles from degree to radians. Here is one example to convert it: a=45 a = math.radians (a) This way, a will become 0.78539816339744828 Test Cases Test your functions with the following arguments for d1, d2, h and a to make sure that your project is working fine Sample output Enter the distance d1: 10 Enter the distance d2: 20 Enter the height of the stage: 20 Enter the angle of the ramp: 45 It takes 2.82 seconds for the bird to hit the pig. The bird must travel at a velocity of 7.42 It takes 2.67 seconds for the bird to hit the pig when the bird is running on the ramp The bird must travel at a velocity of 7.94 when the bird is running on the ramp Enter the distance d1: 0 Enter the distance d2: 10 Enter the height of the stage: 15 Enter the angle of the ramp: e It takes 1.75 seconds for the bird to hit the pig. The bird must travel at a velocity of 2.86 It takes 1.75 seconds for the bird to hit the pig when the bird is running on the ramp. The bird must travel at a velocity of 2.86 when the bird is running on the ramp

Explanation / Answer

def horizontalHit(d1,d2,h):

         g=9.8

         h=0.5*g*(t^2)

         t=math.sqrt((2*h)/g)

         v=(d1+d2)/2

         d=v*t

         print("Velcity:",v)

         print("Time:",t)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote