#include<iostream>
using namespace std;
// FUNCTION PROTOTYPE
string determineLetterGrade(double);
int main()
{
for (int i = 0; i < 2; i++)
{
cout << "STUDENT #" <<
(i + 1) << ":\n-----------\n";
double participationScore, hwScore,
labScore, midScore, finalXamScore;
cout << "Enter the
participation score: ";
cin >>
participationScore;
cout << "Enter the homework
score: ";
cin >> hwScore;
cout << "Enter the labs
score: ";
cin >> labScore;
cout << "Enter the mid score:
";
cin >> midScore;
cout << "Enter the final
score: ";
cin >> finalXamScore;
double totalAssessmentScore =
(participationScore * 0.03) + (hwScore * 0.04) + (labScore * 0.33)
+ (midScore * 0.25) + (finalXamScore * 0.35);
string letterGrade =
determineLetterGrade(totalAssessmentScore);
cout << "Total assessment
score = " << totalAssessmentScore << endl;
cout << "Letter grade = "
<< letterGrade << endl;
}
return 0;
}
// FUNCTION IMPLEMENTATION
string determineLetterGrade(double score)
{
string grade;
if (score >= 95 && score <= 100)
grade = "A";
else if (score >= 90 && score <
95)
grade = "A-";
else if (score >= 85 && score <
90)
grade = "B+";
else if (score >= 80 && score <
85)
grade = "B";
else if (score >= 75 && score <
80)
grade = "B-";
else if (score >= 70 && score <
75)
grade = "C+";
else if (score >= 65 && score <
70)
grade = "C";
else if (score >= 60 && score <
65)
grade = "C-";
else if (score >= 55 && score <
60)
grade = "D";
else
grade = "F";
return grade;
}
********************************************************* SCREENSHOT *******************************************************
CODE SCREENSHOT :
CONSOLE OUTPUT :
Upload at ilearn (under Assignments) a word document that contains the C++ program and the snap-shots...