Sorry about that.
Please help here.
Extremely important.
It says I need to declare the "i" in scores
But im not sure what to do.
#include <iostream>
#include <string>
using namespace std;
int main()
{
//Declaring variables
string names[3] = {"John","Anne","Mary"};
int score[3];
int points[3];
//Ask for scores.
cout << "Enter Scores" << endl << endl;
cout << "Anna Marie: ";
cin >> score[3];
//sort by score
for ( int i = 0; i < 3; i++ )
score[i];
{
for ( int j = 0; j < 3; j++ )
{
if ( score[i] < score[j] )
{
string tmp_string;
int temp;
temp = score[i];
tmp_string = names[i];
//Points
for ( int i = 0; i < n; i++ )
{
if ( names[i].score == 0 )
names[i].points = 0;
else
names[i].points = i + 1;
}
//now swap the names array
score[i] = score[j];
names[i] = names[j];
//now swap the names array
score[j] = temp;
names[j] = tmp_string;
//now swap the names array
}
}
}
//display
for ( int k = 0; k < 3; k++ )
{ cout << names[k] << " : " << score[k] << points[3] << endl;
} return 0;
}