hey guys i just finished my cs program and i need help formatting it i need to get it to look like this:
http://faculty.cs.niu.edu/~byrnes/csci240/pgms/240pgm7.htm
(GO TO PART THAT SAYS VOID ARRAYS)!!!!
but i am getting this:
Annual Garage Sale
Family Item Id # Sale Price Quantity Sold Sale Amount
-----------------------------------------------------------------------------
Corinthos 12345 15.95 1 15.95
Morgan 67800 50.00 3 150.00
Webber 32145 4.50 2 9.00
Davis 98765 75.00 1 75.00
Spencer 44496 11.30 2 22.60
Drake 67356 3.50 4 14.00
Quartermaine 54862 52.50 1 52.50
This is the part in my program that does this information (Im using my setw()'s but i still dont know how to get it formatted to it can be neat and straight.
void printArrays(int family[], int item[], int quantity[], double price[], int numSales)
{
cout << " Annual Garage Sale \n";
cout << "Family Item Id # Sale Price Quantity Sold Sale Amount" << endl;
cout << "------------------------------------------------------------------------------------------------------" <<endl;
for (int i=0; i < numSales; i++)
{
cout << setprecision(2) << fixed << showpoint << familyName(family) << setw(20) << item << setw(23) << price << setw(23) << quantity << setw(20) << price * quantity << endl;
}
}
sorry about long post but if someone could be of some help that would be great.
http://faculty.cs.niu.edu/~byrnes/csci240/pgms/240pgm7.htm
(GO TO PART THAT SAYS VOID ARRAYS)!!!!
but i am getting this:
Annual Garage Sale
Family Item Id # Sale Price Quantity Sold Sale Amount
-----------------------------------------------------------------------------
Corinthos 12345 15.95 1 15.95
Morgan 67800 50.00 3 150.00
Webber 32145 4.50 2 9.00
Davis 98765 75.00 1 75.00
Spencer 44496 11.30 2 22.60
Drake 67356 3.50 4 14.00
Quartermaine 54862 52.50 1 52.50
This is the part in my program that does this information (Im using my setw()'s but i still dont know how to get it formatted to it can be neat and straight.
void printArrays(int family[], int item[], int quantity[], double price[], int numSales)
{
cout << " Annual Garage Sale \n";
cout << "Family Item Id # Sale Price Quantity Sold Sale Amount" << endl;
cout << "------------------------------------------------------------------------------------------------------" <<endl;
for (int i=0; i < numSales; i++)
{
cout << setprecision(2) << fixed << showpoint << familyName(family) << setw(20) << item << setw(23) << price << setw(23) << quantity << setw(20) << price * quantity << endl;
}
}
sorry about long post but if someone could be of some help that would be great.