1. ## c++ help

I'm having trouble with a part of my homework assignment...
I'm not asking for the answer, i just need some pointers! I'm not even sure where to start! (is the answer in the form of a pointer, array, structure, ???) Ive been trying for the past 10hrs straight with hardly anyluck and would love a sample or two, before i start crying

Question:
As facility engineer at a construction site for a new theater, you have been asked by the project architect to determine how many seats need to be ordered in order to fill the theater. The architect wants the seating arrangement to fanout from the stage such that the row of seats nearest the stage has 14 seats with each succeeding row towards the back of the theater has 2 more seats per row than the previous row. When completed, the theater will have a total number of (36) rows.
1-Devise a algorithm which expresses the solution to this problem.
2-Write and run a short C++ program which uses the algorithm to display a tabular listing of the row and the number of seats in that row. Finally, output the total number of seats needed.

Steve

2. >>> is the answer in the form of a pointer, array, structure, ???)

>>> how many seats need to be ordered

... this can only be a single integer value can't it. You can't order a pointer to an array can you?

You need a counter variable, and then loop through the number of seat rows adding 2 to the counter for each iteration, write out the row number and the variable as you go to produce your table.

3. (((Hmm could this work? This displays the row # & amount of seats in reach row)))

#include <iostream.h>
int main()
{
int row=0;
int seats=12;
do
{
row = row++;
seats = seats + 2;
cout << "row " << row << " has "<< seats <<
" seats" << endl;
}
while (row<36);
-----------------------------------------------------------------
OUTPUT:
row 1 has 14 seats
row 2 has 16 seats
all the way to
row 36 has 84 seats

But now im having a hard time finding the total amount of seats!!
i've tried several things to no avail,
could something like this work?
int sumSoFar = 0;
for (int i = 1; i <= 36; i = i + 1)
sumSoFar = sumSoFar + i;
cout << "The sum is: " << sumSoFar << endl;

4. Here's a prettier version, but i still cant find a way to tally the sum of seats...

#include <iostream.h>
#include <iomanip.h>
int main()
{
const float STARTROW = 14;
const float INCREMENT = 2;
long rowtotal = STARTROW;
int row;

cout << "Row Seats\n";
cout << "---- -----\n";
for (row = 1; row <= 36; row++)
{
cout << setw(3) << row << setw(12) << rowtotal << endl;
rowtotal += INCREMENT;
}

return 0;
}

5. in your first version declare an int called totalSeats and intialize to zero outside the loop. Inside the loop increment totalSeats by seats each time through the loop. Output totalSeats only after the loop has been completed.

6. thanks!!!, i love you finally works...