Hey, what i am trying to do is to write a function that inputs a student's average and returns 4 if a students average is 90-100, 3 if the average is 80-89, 2 if the average is 70-79, 1 if the average is 60-69, and 0 if the average is lower than 60. Test your function with a program that allows multiple student averages to be entered and uses a sentinel to terminate the loop.
what i got now is and it doesnt seem to work whenever i type in 70 it will give me 1 2 but i want just a 2 Thanks
#include <iostream>
using namespace::std;
int qualityPoints(int);
#include <iomanip>
int main()
{
int marks;
cout <<"Please enter the students average: ";
cin >>marks;
qualityPoints (marks);
return 0;
}
int qualityPoints (int mark)
{
if (mark == 60,61,62,63,64,65,66,67,68,69){
cout <<"1";
}
else if (mark == 70,71,72,73,74,75,76,77,78,79){
cout <<"2";
}
if (mark == 80,81,82,83,84,85,86,87,88,89){
cout <<"3";
}
return mark;
}