Question: //Programming Assignment: Week 5 Lab //Name: Ikram Khan //Date: April 3 , 2017 //Purpose: Video Game Player Program #include #include #include using namespace std; int

//Programming Assignment: Week 5 Lab

//Name: Ikram Khan

//Date: April 3 , 2017

//Purpose: Video Game Player Program

#include

#include

#include

using namespace std;

int main()

{

string playerNameArray[100];

double scoreArray[100];

int count = 0;

double average = 0;

return 0;

cin.ignore(2);

}

const int Array_size =100;

int inputData();

void displayPlayerData();

void calculateAverageScore();

void displayBelowaverage();

int inputData(string playerNameArray[], int scoreArray[])

{

int count = 0; // count for current player array

while (count < Array_size)

{

cout << "Enter Player Name(Q to quit): ";

cin >> playerNameArray[count];

if (playerNameArray[count] =="q" || playerNameArray[count] == "Q")

{

playerNameArray, scoreArray ; // to break out of loop not sureee

}

cout << "Enter score for "<< playerNameArray[count] << ": ";

cin >> scoreArray[count];

count++; // adding 1 to current player

}// end of while

return 0;

}

void displayPlayerData(string playerNameArray[], int scoreArray[], int count)

{

cout << "Name Score "; // display name and score

for (int i = 0; i

{

cout << playerNameArray[i] << " " << scoreArray[i] << endl;

}

}

double calculateAverageScore(int scoreArray[], int count)

{

int sum = 0; // sum of scores

for (int i = 0; i

{

sum += scoreArray[i];

}

return ((double)sum / count);

}

void displayBelowAverage(string playerNameArray[], int scoreArray[], int count, double average)

{

cout << "Players who scored below average ";

cout << "Name Score ";

for (int i = 0; i

{

if (scoreArray[i] < average)

{

cout << playerNameArray[i] << " " << scoreArray[i] << endl;

}

}

}

can someone fix my code please wont run.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!