Question

Upload at ilearn (under Assignments) a word document that contains the C++ program and the snap-shots of outputs (as you do f

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#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 :

{ Grade.cpp - X $ Student AssessmentWeightGrade (Global Scope) - determineLetterGrade(double: 1 #include<iostream> 2 using na

CONSOLE OUTPUT :

Microsoft Visual Studio Debug Console STUDENT #1: Enter the participation score: 78 Enter the homework score: 88 Enter the la

Add a comment
Know the answer?
Add Answer to:
Upload at ilearn (under Assignments) a word document that contains the C++ program and the snap-shots...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT