Question: A compass needle points a given number of degrees away from North, measured clockwise. Write a program that reads the angle and prints out the
A compass needle points a given number of degrees away from North, measured clockwise. Write a program that reads the angle and prints out the nearest compass direction; one of N, NE, E, SE, S, SW, W, NW. In the case of a tie, prefer the nearest principal direction (N, E, S, or W).
Step by Step Solution
3.21 Rating (159 Votes )
There are 3 Steps involved in it
Answer Please find the program inline comments and output given below packa... View full answer
Get step-by-step solutions from verified subject matter experts
