Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write a grading program for a class with the following grading policies: a. T

ID: 3552943 • Letter: 1

Question

1. Write a grading program for a class with the following grading policies:

a. There are five quizzes, each graded on the basis of 10 points

b. There are five programming assignments, each graded on the basis of 100 points

c. There is two exams and one final exam, each graded on the basis of 100 points

d. There is a project graded on the basis of 100 points

e. The final exam counts for 30% of the grade, each exam counts for 20%, all the

quiz count for 10%, assignments count for 10%, and the project count for 10% of

the grade. (Do not forget to normalize the scores. They should be converted to a

percentage before they are averaged in.)

Any grade of 90 or more is an

Explanation / Answer

Note: One question per one post regarding rules. So, i solved 1 question programme.

Program Code:

//Headers file sections
#include <iostream>
using namespace std;

//Constant members declaration
const int MAX_STUDENTS=5;
const double QUIZES_COUNT=0.10;
const double EXAM_COUNT=0.20;
const double FINAL_COUNT=0.30;
const double ASSIGN_COUNT=0.10;
const double PROJECT_COUNT=0.10;

//Struct type declaration
struct StudentScoresAndGrade
{
    int studentID;
    double pointsInFirstQuiz;
    double pointsInSecondQuiz;
    double pointsInThirdQuiz;
    double pointsInFourthQuiz;
    double pointsInFifthQuiz;
    double pointsInExamCount1;
    double pointsInExamCount2;
    double pointsInAssignCount1;
    double pointsInAssignCount2;
    double pointsInAssignCount3;
    double pointsInAssignCount4;
    double pointsInAssignCount5;
    double pointsInFinalExam;
    double pointsInProject;
    double averageScore;
    char studentGrade;
    double averageOfQuizes;
    double avgOfAssginmetns;

};

//Function prototype
void getStudentDetails(StudentScoresAndGrade& studentDetails);
void calculateStudentGrade(StudentScoresAndGrade& studentDetails);
void displayStudentResult(const StudentScoresAndGrade studentDetails);

//main function
void main()
{
    //Call the methods
    StudentScoresAndGrade studentDetails[MAX_STUDENTS];
    for(int student=0;student<MAX_STUDENTS;student++)
        getStudentDetails(studentDetails[student]);
    for(int student=0;student<MAX_STUDENTS;student++)
        calculateStudentGrade(studentDetails[student]);
   
    for(int student=0;student<MAX_STUDENTS;student++)
    displayStudentResult(studentDetails[student]);
    system("PUASE");
   
}

void getStudentDetails(StudentScoresAndGrade& studentDetails)
{
    cout<<"Enter the student ID:";
    cin>>studentDetails.studentID;

    //Five quizzes, each graded on the basis of 10 point
    cout<<"Enter the number of points in quiz1(MaxPoints=10):";
    cin>>studentDetails.pointsInFirstQuiz;
    cout<<"Enter the number of points in quiz2(MaxPoints=10):";
    cin>>studentDetails.pointsInSecondQuiz;
        cout<<"Enter the number of points in quiz3(MaxPoints=10):";
        cin>>studentDetails.pointsInThirdQuiz;
        cout<<"Enter the number of points in quiz4(MaxPoints=10):";
        cin>>studentDetails.pointsInFourthQuiz;
        cout<<"Enter the number of points in quiz5(MaxPoints=10):";
        cin>>studentDetails.pointsInFifthQuiz;
        //five programming assignments, each graded on the basis of 100 points
            cout<<"Enter the number of points in assignement1(MaxPoints=100):";
            cin>>studentDetails.pointsInAssignCount1;
            cout<<"Enter the number of points in assignement2(MaxPoints=100):";
            cin>>studentDetails.pointsInAssignCount2;
            cout<<"Enter the number of points in assignement3(MaxPoints=100):";
            cin>>studentDetails.pointsInAssignCount3;
            cout<<"Enter the number of points in assignement4(MaxPoints=100):";
            cin>>studentDetails.pointsInAssignCount4;
            cout<<"Enter the number of points in assignement5(MaxPoints=100):";
            cin>>studentDetails.pointsInAssignCount5;
        //Two exams and one final exam, each graded on the basis of 100 points
        cout<<"Enter the number of points in exam1 (MaxPoints=100):";
        cin>>studentDetails.pointsInExamCount1;
        cout<<"Enter the number of points in exam2 (MaxPoints=100):";
        cin>>studentDetails.pointsInExamCount2;
        cout<<"Enter the number of points in final exam (MaxPoints=100):";
        cin>>studentDetails.pointsInFinalExam;
        //project graded on the basis of 100 points
        cout<<"Enter the number of points in project graded(MaxPoints=100):";
        cin>>studentDetails.pointsInProject;
        cout<<endl;
}
void calculateStudentGrade(StudentScoresAndGrade& studentDetails)
{
    double totalOfQuizes;
    double averageOfQuizes;
    double normalizedAverageOfQuizes;
    double normalizedAverageOfAssigns;
    double quizesScore;
    double AssignmentScore;
    double avgOfAssginmetns;
    double ExamScore1;
    double ExamScore2;
    double finalExamScore;
    double projectBased;
    totalOfQuizes=studentDetails.pointsInFirstQuiz+studentDetails.pointsInSecondQuiz+studentDetails.pointsInThirdQuiz+studentDetails.pointsInFourthQuiz+studentDetails.pointsInFifthQuiz;
    averageOfQuizes=totalOfQuizes/5.0;
    normalizedAverageOfQuizes=averageOfQuizes*10;
    quizesScore=normalizedAverageOfQuizes*QUIZES_COUNT;
    ExamScore1=studentDetails.pointsInExamCount1*EXAM_COUNT;
    ExamScore2=studentDetails.pointsInExamCount2*EXAM_COUNT;
    AssignmentScore=(studentDetails.pointsInAssignCount1+studentDetails.pointsInAssignCount2+studentDetails.pointsInAssignCount3+studentDetails.pointsInAssignCount4+studentDetails.pointsInAssignCount5);
    avgOfAssginmetns=AssignmentScore/5.0;
    normalizedAverageOfAssigns=avgOfAssginmetns*10;
    finalExamScore=studentDetails.pointsInFinalExam*FINAL_COUNT;
    projectBased=studentDetails.pointsInProject+PROJECT_COUNT;
    studentDetails.averageScore=quizesScore+AssignmentScore+ExamScore1+ExamScore1+finalExamScore+projectBased;


    if(studentDetails.averageScore>=90)
        studentDetails.studentGrade='A';
    else if(studentDetails.averageScore>=80)
        studentDetails.studentGrade='B';
    else if(studentDetails.averageScore>=70)
        studentDetails.studentGrade='C';
    else if(studentDetails.averageScore>=60)
        studentDetails.studentGrade='D';
    else
        studentDetails.studentGrade='F';
}
void displayStudentResult(const StudentScoresAndGrade studentDetails)
{
    cout<<"Student ID: "<<studentDetails.studentID<<endl;
    cout<<"Points to the first quiz:"<<studentDetails.pointsInFirstQuiz<<endl;
    cout<<"Points to the second quiz:"<<studentDetails.pointsInSecondQuiz<<endl;
    cout<<"Points to the third quiz:"<<studentDetails.pointsInThirdQuiz<<endl;
    cout<<"Points to the fourth quiz:"<<studentDetails.pointsInFourthQuiz<<endl;
    cout<<"Points to the fifth quiz:"<<studentDetails.pointsInFifthQuiz<<endl;
    cout<<"Average of Quizes:"<<studentDetails.averageOfQuizes<<endl;
    cout<<"Points to the first assignment:"<<studentDetails.pointsInAssignCount1<<endl;
    cout<<"Points to the second assignment:"<<studentDetails.pointsInAssignCount2<<endl;
    cout<<"Points to the third assignment:"<<studentDetails.pointsInAssignCount3<<endl;
    cout<<"Points to the fourth assignment:"<<studentDetails.pointsInAssignCount4<<endl;
    cout<<"Points to the fifth assignment:"<<studentDetails.pointsInAssignCount5<<endl;
    cout<<"Average of Assignements:"<<studentDetails.avgOfAssginmetns<<endl;
    cout<<"Points to the exam1:"<<studentDetails.pointsInExamCount1<<endl;
    cout<<"Points to the exam2:"<<studentDetails.pointsInExamCount2<<endl;
    cout<<"Points to the final exam:"<<studentDetails.pointsInFinalExam<<endl;
    cout<<"Average score from all exams:"<<studentDetails.averageScore<<endl;
    cout<<"Project grade:"<<studentDetails.pointsInProject<<endl;
    cout<<"Grade of student:"<<studentDetails.studentGrade<<endl;
}