Okay i have tried everything please can someone help me i am trying to restart this program so i have used a do while loop. The problem is that when i say n to terminating it just asks the question again do i wish to terminate every time i click n
#include <iostream>
using namespace std;
int main ()
{
float total, score, average, minScore=6.0, maxScore=0.0, i;
int divers, judges;
int end;
char choice;
cout << "Enter the number of competetitors please: ";
cin >> divers;
cout << endl;
cout << "Scores input here\t\t\tAveraged scores displayed here\n\n";
do{
while( divers > 0 ) {
total=0.0;
judges=1;
score=0.0;
while( judges <= 5 ) {
cout << "Enter score: ";
cin >> score;
if (score>-0.1 && score<=6.0){
total = total + score;
judges = judges +1;
if(score<minScore){
minScore=score;}
if(score>maxScore){
maxScore=score;}
}else
cout << "the score you entered is not valid please try again.\n";
}
i = i + maxScore + minScore;
total = total - i;
average = total / 3 ;
cout << "Diver score is \t\t\t\t\t " << average << endl;
divers -= 1;
i=0.0;
judges=1;
minScore=6.0;
maxScore=0.0;
total=0.0;
}
cout << "do you wish to terminate the program (y/n)?\n";
cin >> choice;
}while ((choice == 'N') || (choice == 'n'));
cout << "goodbye!\n";
return 0;
}