Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You own an airplane company that needs software to be developed for their flight systems. Specifically, the company wants to know how far their airplanes

image text in transcribed
image text in transcribed
You own an airplane company that needs software to be developed for their flight systems. Specifically, the company wants to know how far their airplanes are from their airports. From your algebra classes you recall being able to find the distance between two points using cither the manhattan distance: manDist=x2x1+y2y1 Or the cuclidean distance: eucDist=(x2x1)2+(y2y1)2 So you devise an algorithm to calculate the distance between two points (i.e. the plane and the airport) using both of these formulas as well as calculating the x-axis distance and y-axis distance so that the pilots and air traffic controllers have multiple measures of the plane's distance. This algorithm follows the following steps: 1. The (x,y) coordinate of the plane is read into floating-point variables. 2. The (x,y) coordinate of the airport is read into floating-point variables. 3. The x-axis distance is calculated by performing the x2 - x1 (where x2 is the plane's x-coordinate and x1 is the airport's x-coordinate) part of the manhattan distance formula. 4. The y-axis distance is calculated by performing the y2y1 (where y2 is the plane's y-coordinate and yl is the airport's y-coordinate) part of the manhattan distance formula. 5. The manhattan distance is calculated (where x2/y2 are the plane coordinates and x1/y1 are the airport coordinates). 6. The euclidean distance is calculated (where x2/y2 are the plane coordinates and x1/y1 are the airport coordinates). 7. The coordinates and values calculated are output to the screen in a pretty format using iomanip1. Note: The

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

HOW did you document WHAT you agreed to?

Answered: 1 week ago

Question

Excel caculation on cascade mental health clinic

Answered: 1 week ago

Question

6. What actions might make employers lose elections?

Answered: 1 week ago