anonymous
  • anonymous
can someone explain what the functions do in this program
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
#include #include using namespace std; //global constants const int MAX_PAIRS=10; //data types struct point { double x, y, distance; }; enum pointType {valuex, valuey, valued}; //functions void readData(point[]); void sortData(point[],pointType); void printData(point[]); int main() { pointType i; point pointList[MAX_PAIRS]; readData(pointList); for(i=valuex;i<=valued;i=pointType(i+1)) { sortData(pointList,i); if(i==valuex) cout<<"this is soorted by x in ascending order"<>pointList[i].x>>pointList[i].y; pointList[i].distance=sqrt(pow(pointList[i].x,2)+pow(pointList[i].y,2)); } } void sortData(point pointList[MAX_PAIRS],pointType whichValue) { int i,last; point temp; bool outOfOrder; for(last=MAX_PAIRS-1;last>=0;last--) for(i=0;i<=last-1;i++) { switch(whichValue)//which field am I sorting by? { case valuex: outOfOrder=pointList[i].x>pointList[i+1].x; break; case valuey: outOfOrder=pointList[i].ypointList[i+1].distance; break; } if(outOfOrder) { temp=pointList[i]; pointList[i]=pointList[i+1]; pointList[i+1]=temp; } } } void printData(point pointList[MAX_PAIRS]) { int i; for (i=0;i<=MAX_PAIRS-1;i++) { cout<
anonymous
  • anonymous
which function.....
anonymous
  • anonymous
there are more than one functions in this program. Please specify any particular function whose operation you want to know.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
@rohitranjan1994 @ADGENIUS I wanted to know what all three functions did

Looking for something else?

Not the answer you are looking for? Search for more explanations.