include <cstdlib>
#include <iostream>
#include <iomanip>
#include <stdlib.h>
using namespace std;
void printintromessage ();
void getUserInput (char& Y);
void printplayerinfo (const int& numofgamesinseries, const int& numofplayersonteam, int& i, int& j);
int main(int argc, char *argv[])
{
const int numofgamesinseries = 3;
const int numofplayersonteam = 4;
int i,j, score[numofgamesinseries][numofplayerson…
char Y = Y;
printintromessage ();
getUserInput (Y);
do
{
if (Y == 'Y' || Y == 'y')
{
printplayerinfo (numofgamesinseries, numofplayersonteam, i, j);
}
else
{
cout << "All finished ? Thank you !" << endl;
}
}
while ((Y == 'Y' || Y == 'y'));
system("PAUSE");
return EXIT_SUCCESS;
}
void printintromessage ()
{
cout << "This program processes bowling scores." << endl;
cout << "The user is asked to enter 3 bowling scores" << endl;
cout << "for each person on the team. There are 4 people" << endl;
cout << "per team. After all the scores are entered" << endl;
cout << "for a player, the program will list the individual" << endl;
cout << "game scores,the player's total score (series), and" << endl;
cout << "the player's average.After each team's input is complete," << endl;
cout << "the program will list the team's total scores by game," << endl;
cout << "the team's total score (series)and the team's average." << endl;
cout << "The user will then be asked if he/she wants to" << endl;
cout << "enter more data. If not, the program will list the" << endl;
cout << "team with the highest total score (series) and that " << endl;
cout << "total. If the user wants to enter more data," << endl;
cout << "the above process is repeated." << endl;
cout << " " << endl;
}
void getUserInput (char& Y)
{
cout << "Do you want to enter (more) data?" << endl;
cout << "Enter Y to continue, anything else to quit: ";
cin >> Y;
cout << " " << endl;
}
void printplayerinfo (const int& numofgamesinseries, const int& numofplayersonteam, int& i, int& j)
{
int score[numofgamesinseries][numofplayerson…
for (i = 1; i <= numofgamesinseries; i++)
{
for (j = 1; j <= numofplayersonteam; j++)
{
cout << "Enter player " << j << "'s score " << i << ": ";
cin >> score[i][j];
cout << score[i][j] << endl;
if (score[i][j] > 0 && score[i][j] <= 300)
{
cout << score[i][j] << endl;
}
else
{
cout << score[i][j] << " is not a valid score ! Score must be from 0 to 300" << endl;
cout << "Enter player " << j << "'s score " << i << ": ";
}
}
}
}
Ok so what is going on here is I am designing a program that stores bowling scores and then averages them up and displays the average and total score of all the players on a team. I set number of games per series (per player) to 3 and 4 players a team. I am attempting to use a multi array but it is not working what am I doing wrong. Also I am having an issues with verifying (such as the scores are only supposed to be between 0 and 300, and if the user inputs 400 it should say invalid input and reprompt them to enter a valid score.
So from the code I have posted what I am doing wrong, I am aware its not complete, but I need to get the score storing down first before moving on, please help I've been at this for many hours