Question: Write a program to compute the destination point (x and y) given the starting point (x and y), the distance, and the horizontal angle, Here

 Write a program to compute the destination point (x and y)

Write a program to compute the destination point (x and y) given the starting point (x and y), the distance, and the horizontal angle, Here are the formulas: a = b.7/180 dx = d.cos(a) dy=d. sin(a) x2 = x1 + dx y2 = yl + dy where b is the horizontal angle in degrees) a is the horizontal angle (in radians) d is the distance between the two points (in feet) dx.dy are the differences between the x and y coordinates, respectively (both in feet) xl,yl are the coordinates of the starting point (both in feet) x2,y2 are the coordinates of the destination point (both in feet) You will need to use the sine and cosine functions, "sin" and "cos" (in the Math class). Write a subprogram to do the calculations and compute the coordinates of the destination point (x2 and y2). The subprogram must return two numbers, so create a 'record' that combines the two into one unit. (Remember that a record is formed by a separate, external class with NO functions..) Then write a main program to ask the user for the inputs, call the subprogram, and then display the result. \ (To save time, you don't have to check for input errors.)

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!