- In this challenge you will create a simple application
that will calculate a compass bearing.
It is actually a very simple decision system
based on a series of "if" statements.
One of the main objectives here
is that you also write some code
for a practical application
and not just a theoretical exercise.
Specifically, the program will ask you
to enter a number between zero and 360,
because there's a total
of 360 degrees possible in the compass.
Then, the program will calculate a direction as follows:
Let's say your input is 45,
your answer would be that you are headed
North 45 degrees East.
If your input is, for example, 123,
then the answer would be that you are headed
South 57 degrees East,
because 123 and 57 is 180, pretty simple.