Hello, I'm trying to run some code that takes the average test scores of students and determines wether or not they are in good academic standing and can graduate if they are seniors. In the second section of else if statements, I have a line that has 2 conditions in it, and I don't know what's wrong with the syntax of them (starred lines). Any help with this is very appreciated!
If the code is too hard to read here's a jsfiddle link to the code :
https://jsfiddle.net/eichtower15/n8ov89jf/
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
string fullName, honorsRank, className;
int year;
int testScore1, testScore2, testScore3, testScore4, testScore5;
int avgScore;
int main()
{
// Retrieve students name
cout << "Please enter your full name: ";
cin >> fullName;
// Retrieve students year of high school
cout << "Please indicate which year of High School you are currently in: ";
cin >> year;
// As for all five test scores
cout << "Please enter your score for the first test: ";
cin >> testScore1;
cout << "Please enter your score for the second test: ";
cin >> testScore2;
cout << "Please enter your score for the third test: ";
cin >> testScore3;
cout << "Please enter your score for the fourth test: ";
cin >> testScore4;
cout << "Please eneter your score for the fifth test: ";
cin >> testScore5;
//Compute the average score of the five tests
avgScore = (testScore1 + testScore2 + testScore3 + testScore4 + testScore5)/5;
// Assign either freshman, sophomore, junior, or senior to the numbered year of high school
if (year == 1)
className = "Freshman";
else if (year == 2)
className = "Sophomore";
else if (year == 3)
className = "Junior";
else if (year == 4)
className = "Senior";
cout << "Name........ " << fullName;
cout << "Year........ " << className;
cout << "Scores...... " << testScore1 << testScore2 << testScore3 << testScore4 << testScore5;
cout << "Average..... " << avgScore;
// Determine students academic standing
if (avgScore >= 97.0)
honorsRank = "**High Honors**", cout << honorsRank << "Note: This student IS ELIGIBLE for graduation";
else if (avgScore >= 95.0)
honorsRank = "**Honors**", cout << honorsRank << "Note: This student IS ELIGIBLE for graduation";
else if (avgScore >= 90.0)
honorsRank = "**Honorable Mention**", cout << honorsRank << "Note: This student IS ELIGIBLE for graduation";
else if (avgScore < 65.0) && (year == 4)*********
cout << "Note: This student is NOT ELIGIBLE for graduation";
else if (avgScore < 65.0) && (year < 4)*********
cout << "Note: This student has been placed on academic probation";
}
return 0;