Question: need help working on this C++ problem. we are barely learning about Structures, Streams & Vectors. 4 THE longestHop PROBLENM Using the Star structure defined
need help working on this C++ problem. we are barely learning about Structures, Streams & Vectors.
4 THE longestHop PROBLENM Using the Star structure defined in file p1.cpp, write the function named longestHop). 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 represent the longest "hop" or span between two stars in the trip. We'll assume that the stars are in 2D space and that you measure the distance using this formula. You may write a function to do so. d- (X2-X1)-+ (y2-y1)2 vectorestar longest longesthop(Stars); =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
