Question: need help working on this C++ problem. we are barely learning about Structures, Streams & Vectors. 6 THE closestDistance PROBLEM Using the Star structure defined
need help working on this C++ problem. we are barely learning about Structures, Streams & Vectors.

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. The function should return a vector of Star containing the two stars that are closest to each other in the trip. We'll assume that the stars are in 3D space and that you measure the distance using this formula. You may write a function to do so. vectorStar closest closestDistance(vStars); 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. The function should return a vector of Star containing the two stars that are closest to each other in the trip. We'll assume that the stars are in 3D space and that you measure the distance using this formula. You may write a function to do so. 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
