Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

can someone explain what the functions do in this program

Computer Science
See more answers at brainly.com
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

#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<
which function.....
there are more than one functions in this program. Please specify any particular function whose operation you want to know.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

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

Not the answer you are looking for?

Search for more explanations.

Ask your own question