Suppose we have been asked to write an application for a surveyor that converts an input compass heading to a conventional bearing.The compass headings are measured in degrees clockwise from the North.A conventional bearing has three components: the direction you face (either North or South), an angle (in the range 0 through 90 degrees inclusive) measured from the North-South meridian and the direction you turn before walking (either East or West).For example:For a compass heading of 119.0 degrees, you would face South (180 degrees) and then turn 61.0 degrees East before walking. Hence the bearing is South 61.0 degrees East, since 180.0 – 119.0 = 61.0.Sample Program Run:Enter a compass heading [0-360 degrees]: 192.5South 12.5 degrees WestWrite a modular program to solve the problem. You must have at least two called functions (main does not count as a called function).One of these functions will be named getBearing. This function will take four arguments in order: 1) a double that is a valid compass heading, 2) a string that will be filled by your function with the direction to face, 3) a double that will be filled by your function with the angle portion of the bearing, and 4) a string that will be filled by your function with the direction to walk. The return type of this function is void.For auto-grading purposes the results for the boundary conditions must be:A compass heading of 0 degrees <=> North 0.0 degrees EastA compass heading of 90.0 degrees <=> North 90.0 degrees EastA compass heading of 180.0 degrees <=> South 0.0 degrees EastA compass heading of 270.0 degrees <=> North 90.0 degrees WestA compass heading of 360 degrees <=> North 0.0 degrees WestFor illustration see Example 11 under Direction in the document (Conventional Bearing).Your program should display all real numbers rounded to exactly one digit to the right of the decimal point.Should the user enter a compass heading outside the range 0 through 360, your program should allow the user to re-enter after displaying the following error message followed by a newline.Error invalid heading entered.