Question: in c++ please 1 of 2 COMP160 Global Direction Program Complete the following program that can calculate the direction from Greensboro to any point on

in c++ please
in c++ please 1 of 2 COMP160 Global Direction Program Complete the

1 of 2 COMP160 Global Direction Program Complete the following program that can calculate the direction from Greensboro to any point on the globe. You will have to convert the math equations to their proper C++ format. Note that atan2 is a method of the cmath library that takes two parameters separated by a comma. 1. Calculate the direction to any place on the earth. /* your name here / #include #include using namespace std; int main() double PI - 3.141592653589793; // value of a /* Declare two doubles, degrees and minutes, to hold the input. * * Declare, latitude, longitude and direction to hold the destination and result * Declare two doubles, longDif and cosLat, to hold temporary values / * Declare gboro Lat and gboroLong and set them to 0.629482084 and -1.36513836 /* Ask the user to enter the degrees and minutes of the destination longitude": * Read degrees and minutes */ * Calculate longitude = (degrees + minutes) * Ask the user to enter the degrees and minutes of the destination latitude * Read degrees and minutes */ * Calculate latitude = (degrees + * Set longDifto longitude minus gborolong *Set cosLat to the cosine of the latitude 60 minutes 60 180 * Calculate direction=atan2 sin(longDif) cosLat, cos(gboro Lat) .sin( latitude ) - sin(gboroLat) cosLatcos longDif)) /* Convert the direction in radians to degrees by degrees = direction /* Display the direction in degrees */ 180 IT

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 Databases Questions!