stuck on for loop

Working on an assignment to practice with arrays and calculate a users grade but am stuck on the initializing for loop on line 54. Don't really know what to put in it. After I get this I can start working on the arithmetic of grade percent. But really need to finish the loop before that. Any advice would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include "CinReader.h"
using namespace std;

CinReader reader;

void print (int numberArray, int sizeOfNumberArray);
void initialize (int numberArray, int sizeOfNumberArray);

int main()
{
    int *gradesEarned;
    int *gradesPossible;
    int totalGrades = 0;

    cout << "You can find your grade for up to ten assignments. " << endl << "How many would you like to grade: ";
    totalGrades = reader.readInt(1,10);
    cout << "\n";

    cout << "Ok, you would like to grade " << totalGrades << " assignments\n\n";


    gradesEarned = new int[totalGrades];
    gradesPossible = new int[totalGrades];

    initialize(gradesEarned, totalGrades);
    initialize(gradesPossible, totalGrades);

    print(gradesEarned, totalGrades);
    print(gradesPossible, totalGrades);

    delete [] gradesEarned;
    delete [] gradesPossible;

    return 0;
}

void initialize (int numberArray[], int sizeOfNumberArray)
{
// Asking Amount of Points earned and possible -------------------------------------------------------

    cout << "How many points did you earn on the assignment: ";
    numberArray = reader.readInt(1,100);
    cout << "\n";

    cout << "Ok you earned " << numberArray << " points on this assignment \n\n";

    cout << "How many points were possible on the assignment: ";
    sizeOfNumberArray = reader.readInt(1,100);
    cout << "\n";

    cout << "Ok there were " << sizeOfNumberArray << " possible on this assignment: ";

    for (int i


}

void print (int numberArray[], int sizeOfNumberArray)
{
    for (int i = 0; i<sizeOfNumberArray; i++)
        cout << numberArray[i] << " __ ";
    cout << endl;

}
Well it isn't too difficult. You already made a for loop in the print function. You obviously know how to extract data from an array. Are you just trying to have the user enter totalGrades number of grades? If so pass both arrays and one size into initialize and loop that many times.

Here is something that you might want to read in case you want to use C++ dynamic sequence containers. It'll save you the trouble of worrying about memory leaks.
http://cplusplus.com/forum/articles/20881/
well whats the loop supposed to do?
Topic archived. No new replies allowed.