Output to a file (STUDENTID.txt) using a scale of 5:1 character-line representing the total distances to the different locations from start is ascending order (i.e. from nearest to farthest location from start)
i. Example LOCATIONS TOT CHARACTER LINE REPRESENTATION
myfile>>a[1]>>b[2]>>c[3]>>d[4]>>e[5];
output.open("0619279_TOTAL_DISTANCE.txt");
//cout<<a<<"\t"<<b[2]<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\n";
cout<<a<<"\t"<<b[2]<<"\t"<<c[3]<<"\t"<<d[4]<<"\t"<<e[5]<<"\n" ;
/*b = North[1];
cout << North[1];
c = South[1];
cout << South[1];
d = East[1];
cout << East[1];
e = West[1];
cout <<West[1];*/
output.close();}
myfile.close();
}
else cout << "Unable to open file";
_getch();
return 0;
}
//int Total_Distance_Calculator(int North[],int South[],int East[], int West[], int d)
//{
// //Simply Add All Values from all these arrays
// return (North[d]+East[d]+South[d]+West[d]);
//}