Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If correct will Rate python Coding Problem 5.1.4 (External resource) (B.0 points possible) FreeBodyObjects.py Submit Run Grades Reset 1 #Rec all in coding Problem 4.4.4

image text in transcribedimage text in transcribedIf correct will Rate python

Coding Problem 5.1.4 (External resource) (B.0 points possible) FreeBodyObjects.py Submit Run Grades Reset 1 #Rec all in coding Problem 4.4.4 (and before that, in coding Console output will be displayed here 2 MProblem 4.3.9) you built a program for finding the net 3 #force (magnitude and angle) on an object from several 4 #individual forces. 6 #in the next two exercises, we're going to convert that 7 #system into one that uses objects 9#To start, create a class called Force. The constructor for 10 #Force should have two required arguments: magnitude and 11 #angle. These should be saved to two attributes called 12 #'magnitude' and 'angle'. You should assume angle is 13#initially in degrees, from-180 to 180 14 15 Then, add three methods to Force: 16 # 17 #-get-horizontal should return the horizontal component 18 # of the force, according to the formula: 19 # horizontal-magnitude * cos (angle). 20 #-get vertical should return the vertical component of # the force, according to the formula: 22 # vertical -magnitude * sin(angle). 23 # -get-angle should return the angle of the force, but 24 # should have a keyword parameter called use degrees 25 # use-degrees should default to True. If use-degrees 26 # is true, it should return the angle in degrees; if it 27 # is false, it should return the angle in radians. 28 # 29 #HINT: Don't overcomplicate this. All we want here is 30 #a class called Force with four methods: init 31 #get-horizontal, get-vertical, and get-angle. Note that 32 #these are not true "getters " even though they have "get" 33 #in their names: all three will have some reasoning 34 #beyond just returning a single value. 35 # 36 #HINT 2: angle will initially be passed into the 37 #constructor in degrees. You may store it in either 38 #degrees or radians. Each approach has different benefits, 39 but make sure to keep track of when it's in angles and 40 #when it's in degrees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions