<pre> int main() { //DECLARATIONS int score1, score2, score3, rounds; bool needInput = true; double total=0.0; double average = 0.0; // average score of an archer do { for(rounds=1; rounds<=4; rounds++) { cout << "Enter Archer's Score:"; cin >> score1; if (score1 > 0, score1 < 60) { needInput=false; } else if(!cin) { cout << "The entry must be an integer."; } else { cout << "The entry must be between 0 and 60."; } } if(needInput=false) { total = total + score1; average = total / 3; cout << "Total Score=" << total << endl; cout << "Average Score=" << average << endl; } else { cout << "You entered invalid entry. You need to enter again."; } return 0; }while (needInput); }
if (needInput = false)
if (needInput == false)
int
cin
!cin
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)