while (testscore1 >= 19 || testscore2 >= 19 || testscore3 >= 19 || testscore4 >= 19 || testscore5 >= 19 || testscore6 >= 19)
{
cout << "You have made an A for this test.\n";
break;
}
while ((testscore1 == 18 || testscore1 == 17) || (testscore2 == 18 || testscore2 == 17) || (testscore3 == 18 || testscore3 == 17) || (testscore4 == 18 || testscore4) == 17 || (testscore5 == 18 || testscore5 == 17) || (testscore6 == 18 || testscore6 == 17))
{
cout << "You have made a B for this test.\n";
break;
}
while ((testscore1 == 16 || testscore1 == 15) || (testscore2 == 16 || testscore2 == 15) || (testscore3 == 16 || testscore3 == 15) || (testscore4 == 16 || testscore4 == 15) || (testscore5 == 16 || testscore5 == 15) || (testscore6 == 16 || testscore6 == 15))
{
cout << "You have made a C for this test.\n";
break;
}
while ((testscore1 == 14 || testscore1 == 13) || (testscore2 == 14 || testscore2 == 13) || (testscore3 == 14 || testscore3 == 13) || (testscore4 == 14 || testscore4 == 13) || (testscore5 == 14 || testscore5 == 13) || (testscore6 == 14 || testscore6 == 13))
{
cout << "You have made a D for the test.\n";
break;
}
while (testscore1 <= 12 || testscore2 <= 12 || testscore4 <= 12 || testscore4 <= 12 || testscore5 <= 12 || testscore6 <= 12)
{
cout << "You have made an F for this test.\n";
break;
}
}
// This program only displays 5 outcomes, and doesn't display them in order.
Here is the execution/program outcome.
Enter your first test score. 18
Enter your second test score. 20
Enter your third test score. 16
Enter your fourth test score. 14
Enter your fifth test score. 12
Enter your sixth test score. 20
You have made an A for this test.
You have made a B for this test.
You have made a C for this test.
You have made a D for the test.
You have made an F for this test.
Good Job on your test
Hope you feel good about your grade.
Test score grades will be as follows.
A 91-100%
B 81-90%
C 71-80%
D 61-70%
F 0-60%
Topazz Tucker
Press any key to continue . . .
Your code is doing exactly what you are telling it to do. In the first if statement, you check to see if any of the scores is a 19+. Because score 2 is, it prints out the 'A' statement. Then it checks to see if any score is a 17 or 18. Because score 1 is, it prints out the 'B' statement.
What you want to do is start with score 1. Check to see if it 19+, 17-18, ... and print out the appropriate message. Then check score 2.
If you have learned how to use arrays (i.e. int score[6];) this would be a great place for a couple of for loops (one for input, one for processing). If you have learned how to define functions, you could put the processing in a function and call it with each of the scores.
Edit: of course you know how to write functions. You have written 2 in the code you posted.