Answer to Question #261277 in Python for khaled

Question #261277

The work formula measures the multiplication of magnitude of displacement (d), the component of the

orce (F), and the angle (8) between d and F. It can be obtained from the following expression:

                   W = F x d x cos(0).

  Write a program which prompts the user to enter d, F, and 0. Then, calculates W and displays

  the computed value for W on the screen. (Notice: You should include all steps and respect the

  Python syntax in order to obtain full mark).

  • Which Python built-in functions did you use to write this program?

  • Which modules in Python did you import? Which functions from the imported modules are

  applied in your program?


1
Expert's answer
2021-11-05T00:33:29-0400
import math
F = eval(input('Enter force here: '))
d = eval(input('Enter distance here: '))
theta = math.radians(eval(input('Enter angle here: ')))
print(F*d*math.cos(theta))

Enter force here: 76
Enter distance here: 5
Enter angle here: 60
190.00000000000003

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog