help with calling functions using arrays

The assignment is rather easy we are given a program shell and just have to correctly call the functions. I got the program to compile but the output is not correct and I believe it is due to some of the function prototypes not making sense to me.

these are the prototypes the professor provided:
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
// -------------------------------------------------------------------------
// File name:   arrayfunctions.h
// Assign ID:   PROG11
// Purpose:     Functions supporting arrays.
// Author:      unixlogin First Last
// ------------------------------------------------------------------------

#ifndef ARRAYFUNCTIONS_H
#define ARRAYFUNCTIONS_H
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;

// ------------------------------------------------------------------------
// Function: Read exactly N integer values into array from keyboard.
// ------------------------------------------------------------------------
void LoadArray(int A[], int N, string Prompt);

// ------------------------------------------------------------------------
// Function: Read up to CAP integer values into array from keyboard, 
//           stopping when CAP values have been read or when the sentinel
//           value is read.
// ------------------------------------------------------------------------
void LoadArray(int A[], int CAP, int & N, int Sentinel, string Prompt);

// ------------------------------------------------------------------------
// Function: Read a user-specified number of integer values into array from 
//           keyboard, where the number of integer values can not exceed CAP.
//
// NOTE:     Input validation is performed to ensure that the specified
//           number of values is in the range 0-CAP.
// ------------------------------------------------------------------------
void LoadArray(int A[], int CAP, int & N, string Prompt);

// ------------------------------------------------------------------------
// Function: Read the M integer values in array from an input stream.
// ------------------------------------------------------------------------
void ReadArray(int A[], int M, istream & inF);

// ------------------------------------------------------------------------
// Function: Display the N integer values in array to the console/screen,
//           ALL ON ONE LINE.
// ------------------------------------------------------------------------
void DisplayArray(int A[], int N, string OutputLabel);

// ------------------------------------------------------------------------
// Function: Write the M integer values in array to an output stream
//           ALL ON ONE LINE.
// ------------------------------------------------------------------------
void WriteArray(int A[], int M, ostream & outF);

// ------------------------------------------------------------------------
// Function: Return the sum of the M integer values in array. 
// ------------------------------------------------------------------------
int ArraySum(int B[], int M);

// ------------------------------------------------------------------------
// Function: Return the average of the M integer values in array. 
// ------------------------------------------------------------------------
float ArrayAvg(int B[], int M);

// ------------------------------------------------------------------------
// Function: Return the max sum of the M integer values in array. 
// ------------------------------------------------------------------------
int ArrayMax(int B[], int M);


and this is how I called them:
the functions from step 3 down are whats giving me trouble
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
 // ------------------------------------------------------------------
// File name:   intarray_a.cpp
// Assign ID:   PROG11a
// Author:      cop3014cjoe Dr. Jones
//
// Purpose:     Use functions to perform the following sequence.
//
//    1. Load exactly 5 values into array ID using prompt "Next value: ".
//    2. Display the values in array ID, with label "Array ID: ".
//    3. Load array Num with values from keyboard terminated by sentinel 7777,
//       using prompt "Enter next value (7777 to STOP): ".
//    4. Display the values in array Num, with label "Array Num: "..
//    5. Display the sum of values in Num as NUM SUM = xxxx
//    6. Display the average (2 decimal places) of values in Num as NUM AVG = xxxx.xx
//    7. Load array Score with the number of values specified by the user.
//       using prompt "Value: ".
//    8. Display the values in array Score, with label "Score: ".
//    9. Display the average (2 decimal places)  of values in Score 
//       as AVERAGE SCORE = xxxx.xx
//
// NOTE: All prompts begin with a new line.
//       All output labels begin with a new line.
//-------------------------------------------------------------------

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
#include "intarrayfunctions.h"

int main()
{

   // -----------------------------------------------------------
   // Declare required constants, variables and arrays.
   // ----
   // NOTE: Have a separate size variable for each array.
   // -----------------------------------------------------------
   const int CAPACITY = 10;   // Max capacity of ALL arrays.
   
   int ID[CAPACITY],          // ID array;
       ID_size = 0;           // Size of ID -- #values being used.
   

   // -----------------------------------------------------------
   // Declare calculation variables.
   // -----------------------------------------------------------
   float Avg;     // Average of array values.
   int Sum;       // Sum of array values.


   //-| -----------------------------------------------------------
   //-| Print copyright notice.
   //-| -----------------------------------------------------------
   cout << endl << "(c)2012 cop3014cjoe Dr. Jones" << endl << endl;

   //-| -----------------------------------------------------------
   //-| 1. Load exactly 5 values into array ID using prompt "Next value: ".
   //-| -----------------------------------------------------------
   LoadArray(ID, 5, "Next value: ");

   //-| -----------------------------------------------------------
   //-| 2. Display the values in array ID, with label "Array ID: ".
   //-| -----------------------------------------------------------
   DisplayArray(ID, 5, "Array ID: ");

   

   //-| -----------------------------------------------------------
   //-| 3. Load array Num with values from keyboard terminated by 
   //-|    sentinel 7777, using prompt "Enter next value (7777 to STOP): ".
   //-| -----------------------------------------------------------
   LoadArray(ID, 10, ID_size, 7777, "Enter next value (7777 to STOP): ");
   //-| -----------------------------------------------------------
   //-| 4. Display the values in array Num, with label "Array Num: ".. 
   //-| -----------------------------------------------------------
   DisplayArray(ID, ID_size, "Array Num: ");
   //-| -----------------------------------------------------------
   //-| 5. Display the sum of values in Num as NUM SUM = xxxx 
   //-| -----------------------------------------------------------
   DisplayArray(ID, ArraySum(ID, ID_size), "NUM SUM = ");

   //-| -----------------------------------------------------------
   //-| 6. Display the average of values in Num as NUM AVG = xxxx.xx. 
   //-| -----------------------------------------------------------
   DisplayArray(ID, ArrayAvg(ID, ID_size), "NUM AVG = ");
   //-| -----------------------------------------------------------
   //-| 7. Load array Score with the number of values specified by the 
   //-|    user, using prompt "Value: " 
   //-| -----------------------------------------------------------
   LoadArray(ID, 10, ID_size, "Value: ");
   //-| -----------------------------------------------------------
   //-| 8. Display the values in array Score, with label "Score: ". 
   //-| -----------------------------------------------------------
   DisplayArray(ID, ID_size, "Score: ");
   //-| -----------------------------------------------------------
   //-|  9. Display the average of values in Score as SCORE AVG = xxxx.xx 
   //-| -----------------------------------------------------------
   int AVG = ArrayAvg(Score, ID);
   DisplayArray(ID, AVG, "Score AVG = ");
   //-| -----------------------------------------------------------
   //-| Print copyright notice.
   //-| -----------------------------------------------------------
   cout << endl << endl << "(c)2012 cop3014cjoe Dr. Jones" << endl;

   return 0;

}//main 
the problem i am having is with the
void DisplayArray(int A[], int N, string OutputLabel);

function. It is asking for an int N but not one is given.
Topic archived. No new replies allowed.