a one dimensional array is not what you need... a little pseudo code for you to maul over...
1 2 3 4 5 6 7 8 9 10 11
int seat [student] [seat_number]; a two dimensional will work better I think
for (j=0;j<=seat;j++){
if (j is not right) {
do something to fix it here
}
else{
seat_number=j;
cout << seat[ student #0] [seat_number];
}
1. The program should read three numbers .
2. The first number is the number of students, the number of rows and the number of seats in a row ( same for every row ).
3. There will be one empty seat between every two neighboring students on the same row or on the same column.
4. After user input the number of student, rows and seats in a row, the program should compute and print out the maximum number of students that the classroom can support.
5. The program will stop immediately if the number of student provided by the user is larger than the maximum value. Otherwise, The program should also print out the seating plan row by row on the screen.
6. If a seat is taken by a student, it will simply print out his/her student ID. Otherwise, -1 will be printed.
7. This project assumes that the student IDs are 1000001 for the first student, 1000002 for the second......
8. The width of output is set to 10 .