Q:

Program to calculate the CGPA percentage

belongs to collection: Basic Programs

0

Explanation

In this program, we have to calculate the CGPA percentage of five subjects( English, Hindi, Maths, Science and Social Study).

CGPA ( Cumulative Grade Point Average ) is the systematic arrangement in the educational stream to get average of grade points. And the CGPA percentage is 9.5 times the CGPA.

CGPA = (Grades in all Subjects) / (Total Number of Subjects).

So, CGPA= 9.5 × CGPA

Formula

CGPA = 9.5 × CGPA 

Algorithm

  1. Enter grades in every subject.
  2. Apply in formula CGPA.
  3. Calculate CGPA percentage.
  4. Print the CGPA percentage.

Complexity

O(1)

CGPA percentage is = (float)(9.5 * (CGPA));

Input:

CGPA = (Grades in all Subjects) / (Total Number of Subjects).  

English = 9.1;  

Hindi = 8.5;  

Maths = 9.5;  

Science =9.6;  

SocialStudy = 8.6;  

CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0);  

Output:

CGPA percentage is = 86.070000

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python

English = 9.1  
Hindi = 8.5  
Maths = 9.5  
Science =9.6;  
SocialStudy = 8.6  
CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0)  
CGPAper = 9.5 * (CGPA)  
print(" CGPA percentage is:");  
print(CGPAper);   

 

Output:

CGPA percentage is:  
86.07000000001

 

C

#include<stdio.h>  
int main()   
{   
double English , Hindi ,Maths, Science, SocialStudy, CGPA , CGPAper ;  
English = 9.1;  
Hindi = 8.5;  
Maths = 9.5;  
Science =9.6;  
SocialStudy = 8.6;  
CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0);  
CGPAper = (float)(9.5 * (CGPA));  
printf("\n\n CGPA percentage is: %f",CGPAper);  
return (0);  
}

  

Output:

CGPA percentage is:  86.070000

 

Java

public class CGPAProgram  
{     
public static void main (String args[])  
    {     
    double English, Hindi, Maths, Science, SocialStudy, CGPA, CGPAper ;  
    English = 9.1;  
    Hindi = 8.5;  
    Maths = 9.5;  
    Science =9.6;  
    SocialStudy = 8.6;  
    CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0);  
    CGPAper = (float)(9.5 * (CGPA));  
    System.out.println(" CGPA Percentage is:  "+CGPAper);  
    }  
}

 

Output:

CGPA Percentage is:  86.06

 

C#

using System;  
class Program  
{   static void Main()   
    {  
      double English, Hindi, Maths, Science, SocialStudy, CGPA, CGPAper ;  
  
                  English = 9.1;  
                  Hindi = 8.5;  
                  Maths = 9.5;  
                  Science =9.6;  
                  SocialStudy = 8.6;  
                  CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0);  
                  CGPAper = (float)(9.5 * (CGPA));  
  
        Console.WriteLine("CGPA percentage is:"+CGPAper);  
    }  
}

  

Output:

CGPA percentage is:  86.06

 

PHP

<?php  
       $English = 9.1;  
       $Hindi = 8.5;  
       $Maths = 9.5;  
       $Science =9.6;  
       $SocialStudy = 8.6;  
             $CGPA = (9.1+8.5+9.5+9.6+8.6)/(5.0);  
             $CGPAper = 9.5 * $CGPA;  
       echo("CGPA percentage is= ");  
       echo($CGPAper);  
?> 

 

Output:

CGPA percentage is =  86.07

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Program to convert Celsius into Fahrenheit... >>
<< Program to find the volume of the cylinder...