function with two constants iterated!

I have two constants,NUMSELLER and NUMBUYER.am trying to write a for loop with NUMSELLER iterations, which on each iteration calls getNextBid() to produce 1 seller bid, and another loop with NUMBUYER iterations to produce the buyer bids.
function two arguments and in addition to setting the nextBid value.

[code]

Simulator::Simulator(int a, int b)

for (int i;i<NUMBIDS;i++)
for(int i=0;i<=NUMBUYERS;i++)
{
...........
for (int j=0;j<=NUMSELLER;j++)
a = getNextBid()
}
[code]
why not?
Am not so sure of how to handle the Constants NUMSELLER and NUMBUYER to be iterated so that on each iteration calls getNextBid() to produce 1 seller bid, and another loop with NUMBUYER iterations to produce the buyer bids.
I want this loop to create one bid for every iteration of the boop, unfortunately it I get just one type and one trdId. NUMSELLER = 1 NUMBUYER = 1
NUMBIDS = 10.
Expected results:
0A
0A
0A
0A
0A
1B
1B
1B
1B
1B

1
2
3
4
5
6
7
8
9
10
11
12
13
14
voiid Trader::getNextBid() { 
        int trdId; char type;
        for(int i = 0; i < NUMSELLER+NUMBUYER; i++)  {
           for(int j = 0; j < NUMBIDS; j++)
           {
                   if (i %2==0)
                           type = 'B';
                   else
                           type = 'A';}
           trdId = i;    
           }
           return getNextBid(trdId,type);
}
Last edited on
Topic archived. No new replies allowed.