Write a Compass class. A compass provides bearings. A bearing is a measure of direction as indicated by clockwise rotation around a circle. There are 360 degrees in a bearing, and within each degree are 60 minutes. Thus, a legal bearing would be 270 degrees, 36 minutes (approximately due west). There are never more than 359 degrees in a bearing or more than 59 minutes in a bearing. Both degrees and minutes are integer values. Include the following methods:
(a) __
init__ ,__str__ ,__repr__ .(b) Addition allows for both bearing-to-bearing operations and bearing-to-integer operations. If one argument is an integer, the integer is assumed to represent degrees. Addition should be commutative!
(c) Output should always be rounded to the minute.
(d) If inappropriate values are passed to the constructor, the created bearing instance should get a value of 0 degrees, 0 minutes.
Include sample code that uses your class and demonstrates the use of all methods as well as error handling.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.