The teacher wants to know if the whole class passed the quiz (60 is a pass). Write all_passed(scores): true if everyone passed, false as soon as one score is under 60. No scores gives true.
all_passed({75, 60, 88})→Trueall_passed({90, 59})→Falsebool all_passed(const vector<int> &scores)#include <vector>
using namespace std;
bool all_passed(const vector<int> &scores) {
for (int s : scores) {
// your code here: if one is under 60, return false right away
}
return true;
}
Run tries the examples. When they look right, Submit.