JSFiddle - React, Tailwind, and code Playground
by Pavel Stefan
HTML
#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...