I'm new to coding. I wrote the below code in C++ and I am not allow to use array.
You will create a console C++ program that uses a nested loop to enter each archer's individual end scores and then displays the total score for each archer.
I am stuck at how to calculate the total end score:
#include <iomanip>
using namespace std;
int main()
{
    int Rounds = 4;
    int Archers = 3;
    int endScore ;
    int average;
    for (int a = 1; a <= Archers ; a++)
    {
        cout <<  endl << "Number " << a << " score" << endl;
        int tEndScore = 0 ;
        for(int i=1; i <=Rounds ; i++)
        {
            cout << "Round " << i << " : " ;
            cin >>  endScore;
            while(cin.fail())           
            {
                cout << endl << "not enter an integer " << endl ;                             
                cout << "Please enter an integer ";
                cin >> endScore;
            }
            tEndScore += endScore;
        }
        cout << endl << "The total score for 4 ends of Archer Number " << a << " is " << tEndScore << endl;
        average =(double) tEndScore/Rounds;
        cout << setiosflags(ios::fixed) << setprecision(2) << endl << "The average score of 4 ends of Archer Number " << a << " is " << average << endl;
    }
}
This is the result after running. It will only use the last value I entered as tEndScore:

 
     
     
    