Question: Skeleton here and the student tests are under too. #include #include #include #include #include using namespace std; struct Star { double x, y, z, magnitude;

Skeleton here and the student tests are under too.
#include #include #include #include #include
using namespace std;
struct Star { double x, y, z, magnitude; int draperNumber; string names; };
//Function below here
//Function above here
ostream& operator
const vector vStars = { {-0.516566, -0.340233, 4.53, 124675, "BOO KAPPA"}, {-0.391537, 0.791148, 1.16, 62509, "POLLUX; GEM BETA"}, {-0.798418, 0.601749, 4.54, 82446, "HYA TAU"}, {0.544153, 0.174444, 4.34, 6961, "CAS THETA"}, {-0.843478, 0.099816, 3.54, 100407, "HYA XI"}, {-0.455459, -0.603227, 4.98, 138629, "BOO NU"}, {-0.298198, 0.387683, 3.35, 71369, "MUSCIDA; UMA OMICRON"}, {-0.696134, 0.155399, 3, 96833, "UMA PSI"}, {-0.916842, 0.246614, 4.08, 95272, "ALKES"}, {0.11301, 0.945279, 2.58, 36673, "ARNEB"}, {0.214075, -0.813927, 3.25, 176437, "SULAFAT; LYR GAMMA"}, {0.305802, 0.232677, 4.46, 15089, "CAS IOTA"}, {0.658924, -0.733896, 3.78, 198001, "ALBALI"}, {0.820248, 0.448325, 2.64, 11636, "SHERATAN"}, {-0.263867, 0.822592, 4.41, 54719, "GEM TAU"}, {0.148253, -0.755971, 5.37, 173608, "LYR EPSILON"}, {-0.741021, -0.628146, 3.78, 129246, "BOO ZETA"}, {-0.188502, -0.981846, 5.89, 156247, "U OPH"}, {0.147985, -0.755362, 6.02, 173583, "LYR EPSILON"}, {-0.317623, 0.871206, 3.5, 56986, "WASAT; GEM DELTA"}, };
vector closest = closestDistance(vStars); cout " "
cout
ostream& operator
if (len > 0) { out
out
return out; }
6 THE closestDistance PROBLEM Using the Star structure defined in file p1.cpp, write the function named closestDistance) The function takes one input parameter: a vector of Stars that represents a "travel itinerary". Visit every pair of stars in-order (0-1, 1-2, 2-3, etc.) and measure the distance between them oihettethtrftar cont t atre cosetoe We'll assume that the stars are in 3D space and that you measure the distance using thisdV(r2-1)- + (32-y1 formula. You may write a function to do so. + (22-21) vectorStar closest closestDistance(vstars)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
