TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Program to calculate the CGPA percentage

Program to calculate the CGPA percentage on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph etc.

<< Back to PROGRAM

Program to calculate the CGPA percentage

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)


Solution

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

Next Topic#




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf