#include <iostream>
#include <stdlib.h>
#include <vector>
usingnamespace std;
int main() {
vector<int> Grades;
int input;
float mean = 0;
cout << "input grades and I will determine the average, and the print all below average grades. input -1 when you are ready.\n";
while(input!=-1){
cin >> input;
Grades.push_back(input);
}
for(int i = 0; i < Grades.size();i++){
mean = mean + Grades[i];
}
mean = mean / Grades.size();
cout << "The average is " << mean << ". These grades are below the average:\n";
for(int i = 0; i > Grades.size(); i++){
if(Grades[i] <= mean){
cout << Grades[i] << "\n";
}
if(i == Grades.size()){
cout << "No grades were below the mean! Huh.";
}
}
}
jonnin - thank you for your help. I accidently did greater than when I meant to put a less than. however, that wouldn't have worked if you didn't tell me to add " if(input != -1) "