Video game Player + scores

Hey there guys, I'm doing a program that requires me to take the player names and scores and then display every player listed with their score and after that display all the players that scored below average.

Write a program to do the following. In main declare a Player Name Array and a Score Array. Declare the size of the arrays to be 100. In the InputData function input the player name and score into the arrays for an unknown number of players up to 100. In the DisplayPlayerData function display the name and score of each player. In the CalculateAverageScore function calculate the average score and return it by value. In the DisplayBelowAverage function display the name of the player and score for any player who scored below the average. Do not use global variables.

Output from Program:

Enter Player Name (Q to quit): Bob
Enter score for Bob: 3245
Enter Player Name (Q to quit): Sue
Enter score for Sue: 1098
Enter Player Name (Q to quit): Dave
Enter score for Dave: 8219
Enter Player Name (Q to quit): Pat
Enter score for Pat: 3217
Enter Player Name (Q to quit): Q

  Name   Score
Bob        3245
Sue        1098
Dave       8219
Pat        3217

Average Score: 3944.75

Players who scored below average
  Name    Score
Bob        3245
Sue        1098
Pat        3217
Press any key to continue .
.

PSEUDO-

Main Function
Declare the player name and score arrays, number of players, and average score.

Call the InputData function
Call the DisplayPlayerData function
Call the CalculateAverageScore function and assign the returned value in average score
Call the DisplayBelowAverage function

InputData function
While the number of players is less than the length of the array
Prompt for the player's name
If the user entered Q, break out of the loop
Prompt the user for the player's score
Add 1 to the number of players
End-While

DisplayPlayerData function
Display the name and score of each player

CalculateAverageScore function
Add up the scores and divide by the number of scores to calculate the average score
Display the average score
Return the average score to main

DisplayBelowAverage function
Display the names and scores of all players who scored below the average score

Here is what I have so far.

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
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

const int ARRAY_SIZE = 100;

void inputData(); 
void playerData();
double calcAvgScore();
void displayBelowAvg();

void main()
{



}

void inputData() 
{
	string playerName;

	while ()
		cout << "Enter player's name (''Q'' to quit)";
	cin >> playerName;


}

void playerData()
{

}

double calcAverageScore()
{

}

void displayBelowAvg()
{

}


I was just wondering if anybody can give me a few pointers as to where to go from here specifically setting up the loops to work correctly with the program to match the sample output.

Thanks a lot guys, anything else I can do to help I will - just ask. I'm going to continue working while I wait for a response.
Also, I figured I should mention I'm a complete beginner as of a few weeks ago, so please go easy on me here.
I assume you're using single dimentional arrays. Your inputData() routine should look something like this:
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

string players[ ARRAY_SIZE ];

int scores[ ARRAY_SIZE ];

void main()
    {
    inputData();

    }
        /*    main()    */

void inputData()
    {
    string playerName;

    int
        i,
        playerScore;

    i = 0;

    while( 1 )
        {
        cout << "Enter player's name ('q' to quit)";

        cin >> playerName;

        if( 'q' == playerName( 0, 1 ) )
            break;

        cout << "Enter Player's score";

        cin >> playerScore;

        players[ i ] = playerName;

        scores[ i ] = playerScore;

        i++;

        if( ARRAY_SIZE <= i )
            break;


        }    /*    while( 1 )    */



I hope this little bit helps.
Topic archived. No new replies allowed.