I've spent over an hour on this and I still cannot get the data in the way that I want it. Really frustrating because this is so easy. My output right now is this:
0.00 miles: 3Wartburg_TN
37.64 miles: 2Knoxville_TN 37.64
671.37 miles: 5New_York_NY 633.72
4547.77 miles: 27Frankfurt_DE 3876.40
7597.51 miles: 23Lagos_NG 3049.74
and the output I want is this:
0.00 miles : 3 Wartburg_TN
37.64 miles : 2 Knoxville_TN 37.64 miles
671.37 miles : 5 New_York_NY 633.73 miles
4547.77 miles : 27 Frankfurt_DE 3876.40 miles
7597.51 miles : 23 Lagos_NG 3049.74 miles
I can not for the life of me figure out how to get the correct output. Here's what I have so far for the code. Am I not using right and left justified correctly?
cout <<fixed <<setprecision(2) <<setw(8) << right << vdist[ij] << " miles: "
<< ij << setw(25) << left << vec[ij].cityname
<< setw(18) << right << vedge[ij]<<endl;