Question #179246

Write a C++ Program that computes the grade of a student who did the following subjects together with their scores. The students did 5 subjects. The application should show the average that the student scored together with the grade awarded.  You can use subjects and grades of your choice. The grades should be in percentage. 

Expert's answer

#include<bits/stdc++.h>
using namespace std;
 
double CgpaCalc(double marks[], int n)
{
    
   
    double grade[n];
 
    /
    double cgpa, sum = 0;
 
    
    for(int i = 0; i < n; i++)
    {
       grade[i] = (marks[i] / 10);
    }
 
  
    for(int i = 0; i < n; i++)
    {
       sum += grade[i];
    }
 
    
    cgpa = sum / n;
 
    return cgpa;
}
 
int main()
{
    int n = 5;
    double marks[] = { 90, 80, 70, 80, 90 };
 
    double cgpa = CgpaCalc(marks, n);
         
    cout << "CGPA = ";
    printf("%.1f\n", cgpa);
    cout << "CGPA Percentage = ";
    printf("%.2f", cgpa * 9.5);
}
 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS