hey hey hey

with the following code which is pretty simple, it works fine except for the line: item[5].grossF();

this in turn displays the gross of only item 5 which is basically just the items total...

i want it to add all the gross total together and then display the sum as the variable grossT?

any help will recieve copious amounts of sex in return!

thanks

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

// Defining the stock structure
struct stock
{
// Variables
int quantity;
string name;
float price;
float total[6];
float grossT;

// Functions
void calc(int j);
void display(int i);
void grossF();
};

// Function which calculates total value of stock
void stock::calc(int j)
{
total[j] = (price * quantity);

grossT = grossT + total[j];
}

// Function which prints headings and border to the screen
void header()
{
cout << setw(15) << "Stock Item" << setw(15) << "Quantity" << setw(20) << "Unit Price" << setw(20) <<"Total Value\n";
cout << "----------------------------------------------------------------------\n";
}

// Function displays name, quantity, price and calculated total for each stock type
void stock::display(int i)
{
cout << setiosflags(ios::showpoint | ios::fixed) << setprecision(2);
cout << setw(15) << name << setw(15) << quantity << setw(20) << price << setw(20) << total[i] << "\n";
}

// Prints the bottom border
void footer()
{
cout << "----------------------------------------------------------------------\n";
}

// Calculates total value of entire stock
void stock::grossF()
{
// Displays footer with gross title and calculated value
cout << setw(53) << "Gross Total: " << setw(17) << grossT << "\n";
}

// main function which controls program flow initializes structure items
void main()
{
// Decleration of struct items
stock item[6];
item[0].name = "Television";
item[0].price = 368.00;
item[1].name = "Video Recorder";
item[1].price = 268.00;
item[2].name = "Camera";
item[2].price = 300.00;
item[3].name = "DVD";
item[3].price = 468.00;
item[4].name = "Hi Fi Stereo";
item[4].price = 2500.00;
item[5].name = "Video CD";
item[5].price = 345.00;
item[0].grossT = 0;
item[1].grossT = 0;
item[2].grossT = 0;
item[3].grossT = 0;
item[4].grossT = 0;
item[5].grossT = 0;

cout << "PLEASE ENTER STOCK QUANTITY, ENTER 0 TO EXIT PROGRAM...\n\n";

// For loop which collects quantity of each stock from user
for (int counter = 0; counter < 6; counter++)
{
cout << "Please enter the number of " << item[counter].name << "s: ";
cin >> item[counter].quantity;
}

cout << "\n";

// For loop which calculates total value of each stock
for (int j = 0; j < 6; j++ )
item[j].calc(j);

header();

// Displays stock name, price and total value using a for loop
for (int i = 0; i < 6; i++ )
item[i].display(i);

// Footer function
footer();

// Displays gross total of all stock
item[5].grossF(); this is the line!!!

cout << "\n\n";
}