Question: 1 ) Create a class called Current. The initialization method should give an initial velocity and direction which will default to 0 degrees ( due

1) Create a class called Current. The initialization method should give an initial velocity and direction which will default to 0 degrees (due north.) Add a method called get_vector() that returns the current velocity and direction. Each time get_vector() is called the velocity will randomly change in the range of 0.5 to 2.0 and the direction will change 5 degrees. (The velocity will be feet per iteration.)2 pts
2) Create a class called Location to track the location an object, and a class called Canal to hold our rubber ducks, it also has a width An attribute of the canal should be the current. If an object hits the bank the vector will reflect off of the bank - that is if the direction is 45 degrees the reflection would be 135 degrees. 2 pts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!