I am trying to make it read:
First Name:
Last Name:
Score 1: " "
More? Y
Score 2: " "
More? N
That is the output but when it asks 'more?' whatever I press it keeps going to the next score. How do I make it quit the program when I type the letter n or N?
for ( i = 0; i < SIZE; i++)
{
cout << "Score " << i + 1 << ": ";
cin >> scores[i];
cout<<"More? :";
cin>>more;
if( more != 'y' && more != 'Y' )
{
//nothing to do here
break;
}
}
edit: forgot to put anything but code. This looks a good candidate for breaking out of the loop if the user says they want no more. As Moschops said you gotta think about what your if conditions could evaluate out to.