I'm doing a program for my class where I input a .txt file and output as another. I have the entire program done. I just don't know how to format it. Its kinda sad. Considering formatting isn't even that difficult from what I understand. Guess I should have paid attention those 2 days. Well I was wonderin if you guys could give me an idea of what I need to do.
My PrintData.cpp file reads...
And its outputing this...Code:#include "WrestlingHeader.h"
void printwrestlerdata(struct person wrestler[], int count, int l, int m, int h)
{
int i;
ofstream outdata;
outdata.open("Output.txt");
outdata<<"Name Weight Class"<<endl;
for( i = 0; i<count; i++)
{
outdata<<endl<<wrestler[i].full_name.first<<" "
<<wrestler[i].full_name.last<<" "
<<wrestler[i].weight<<" ";
if(wrestler[i].status == lightweight)
{
outdata<< "Lightweight";
}
else if(wrestler[i].status == middleweight)
{
outdata<<"Middleweight";
}
else
{
outdata<<"Heavyweight";
}
}
outdata<<endl<<endl<<"Total number of Lightweights is "<<l<<endl
<<"Total number of Middleweights is "<<m<<endl
<<"Total number of Heavyweights is "<<h<<endl
<<"Total number in all weight classes is "<<i<<endl;
return;
}
Code:Name Weight Class
Mark Bartel 238 Heavyweight
Bob Byrnes 166 Middleweight
Tim Holden 95 Lightweight
Jim Jackson 175 Middleweight
Dave Johnson 98 Lightweight
Joe Jones 256 Heavyweight
Rick Leeds 148 Middleweight
Ralph Long 158 Middleweight
Mike Murphy 184 Middleweight
Dick Nickels 210 Heavyweight
Total number of Lightweights is 2
Total number of Middleweights is 5
Total number of Heavyweights is 3
Total number in all weight classes is 10
I was wondering, how do I line up the 3 columns?
Much thanks in advance,
Zach