Having some problems displaying this. The code runs fine but I can't space out each elements of the array equally. The "setw" function only puts a space after the output so the alignment is messed up by the length of the strings in the array. What I need is a way of making the width of each string in the arrays the same. I don't want to put spaces in the string, its a bit crude.
CODE
string speed[5]={"Reasonable","Fast","Lightning","Slow Poke","Fast"};
string jump[5]= {"Very Good ","Average","Poor ","OK ","Awesome"};
string luck[5]= {"Jammy","Unlucky","Very Jammy","Very Unlucky","No chance"};
float cost[5]={100,250,400,100,400};
//display horse names and abilities
cout<<setw(15)<<brian<<setw(15)<<elvis_returns<<setw(15)<<vodka_breath<<setw(15)<<naka<<setw(15)<<ate_my_horse<<endl;
cout<<"Speed: "<<setw(5);
for (i=0; i<5; i++)
{
cout<<speed[i]<<setw(15);
}
cout<<"\nJumping: "<<setw(5);
for (i=0; i<5; i++)
{
cout<<jump[i]<<setw(15);
}
cout<<"\nLuck: "<<setw(5);
for (i=0; i<5; i++)
{
cout<<luck[i]<<setw(15);
}
cout<<"\nCost: "<<setw(5);
for (i=0; i<5; i++)
{
cout<<cost[i]<<setw(15);
}