Somebody help me build this program, its sort of challenging...Instructions say to store player's name, number and points scored by each player...Program should keep an array of 12 of these structures, each element is for a different player ona team...program should ask user to enter the data above for each player...It should show a table that lists each player's number, name and points scored... It should calculate and display total points earned by team. Number and name of player that earmed the most points should be displayed...
This is what I have:
#include <iostream>
using namespace std;
const int PLAYER_SIZE=40;
struct soccerData
{
int numberPlayer;
int pointsScored;
char description[PLAYER_SIZE];
};
int main()
{
const int NUM_PLAYERS=12;
soccerData players[NUM_PLAYERS];
int index;
//Ask info
cout<< "Enter names, numbers, and points: "<<NUM_PLAYERS;
for (index=0; index<NUM_PLAYERS; index++)
{
//get name
cout<< "Players name "<<(index+1);
cout<< ": ";
cin>> players[index]. numberPlayer;
//get points
cout<< "Points scored "<<(index+1);
cout<<": ";
cin>>players[index].pointsScored;
//get numbers
cout<<"Player's name "<<(index+1);
cout<<": ";
cin>>players[index].numberPlayer;
}
//Display
cout<<"Total points:\n";
for(index=0; index<NUM_PLAYERS; index++)
{
double total;
total=players[index].pointsScored*12;
cout<<"Total points "<<(index+1);
cout<<": "<<total<<endl;
}
return 0;
}
I get stuck after this...
What I get from the instructions is that each structure should be for a different player...also that loops should be involved...loops should ask the user the questions needed...
Help me make this program please!!?