Answer to Question #179246 in C++ for Ian

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. 

1
Expert's answer
2021-04-08T04:13:23-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS