I declared 4 different arrays. I dont know how to display all the arrays. Can anyone please help me with this? I want to display all 4 arrays like this:

Student 1   2   3   4   5   6   7   Time          Status    Final

1           0   0   0   0   0   0   0   6.50            B                0
2           5   6   7   8   2   1   3   4       C               0
3           0   0   0   0   0   0   0   7.50    B                0
4           3   4   5   1   2   9   4   12      A                0





const int NUM_STUDENT = 4;
const int NUM_QUIZ = 7;
int student = 0;
int quiz = 0;
double grade[NUM_STUDENT][NUM_QUIZ] = {{0, 0, 0, 0, 0, 0, 0},
                                        {5, 6, 7, 8, 2, 1, 3},
                                        {0, 0, 0, 0, 0, 0, 0},
                                        {3, 4, 5, 1, 2, 9, 4}};

double time[4] = {9, 10.5, 10.5, 12};
char status[4] = {'B', 'C', 'B', 'A'};
double final [4] = {0, 0, 0, 0};

Recommended Answers

All 4 Replies

use a for loop

I know I have to use for loop but I don't how to do it.

Once you fill the array, loop though each element of the array and use a simple cout statement to output the element.

For the double dimension you need a loop within a loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.