GPA and CGPA Calculator using C++ | How to Program

GPA and CGPA Calculator using C++ | How to Program

GPA and CGPA Calculator using C++ | How to Program


GPA and CGPA Calculator using C++ | How to Program

OUTPUT

GPA and CGPA Calculator using C++ | How to Program


GPA and CGPA Calculator using C++ | How to Program











#include <iostream>
#include<conio.h>
float gpa(float );
using namespace std;
float gpa(float nmbr)
{
    cout << "\ntotal Number of subjects: ";
    cin >> nmbr;
    float l,tg,i,n,gp,g;
    int c;
    for( c = 0; c < nmbr; c++)
{
        cout << "\nMarks of sbj no. " << c+1 << " = ";
        cin >>n;
        cout<<"\ncradit hours of that sbj. "<<c+1<<" = ";
        cin>>l;
        if(n<=49.9)
        i=0;
        if(n<=54.9&&n>=50.0)
        i=1.4;
        if(n<=59.9&&n>=55.0)
        i=1.7;
        if(n<=64.9&&n>=60.0)
        i=2;
        if(n<=69.9&&n>=65.0)
        i=2.3;
        if(n<=74.9&&n>=70.0)
        i=2.7;
        if(n<=79.9&&n>=75.0)
        i=3;
        if(n<=84.9&&n>=80.0)
        i=3.3;
        if(n<=89.9&&n>=85.0)
        i=3.7;
        if(n>=90.0&&n<=100.0)
        i=4.0;
        if(l==4)
        i=i*4;
        if(l==3)
        i=i*3;
        tg=tg+l;
        gp=gp+i;
    }
            g=gp/tg;
    return g;
}
int main()
{
    float s,s1=0,m,n,ts;
    cout<<"\nenter the number of smesters:";
    cin>>ts;
    for(int i=0;i<ts;i++)
{
cout<<"\nfor smester:"<<i+1;
s=gpa(n);
    cout<<"\nGPA of smester : "<<i+1<<" = "<<s<<endl;
    s1=s1+s;
   }
   cout<<" CGPA = "<<s1/ts;
   getch();
}

COMMENTS

BLOGGER: 1
Loading...
Name

Blogger-Templates,1,Blogging,4,C++,11,Facebook,1,Free-Premium,1,Freebies,4,Google,1,Hack-Facebook,1,Programming,11,SEO,3,Social-Media,1,Softwares,3,Widgets,1,
ltr
item
Online Blogger Tricks | A2Z Art of Blogging: GPA and CGPA Calculator using C++ | How to Program
GPA and CGPA Calculator using C++ | How to Program
GPA and CGPA Calculator using C++ | How to Program
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1whQ4Z4kiP07ij8Oloa5Rq4Mvdwm2QXuZOl7hYfmcsvzU9NwWwQVi2_lCDXrkSUx7HLp43CfNRXffmhlZkUrwEB2w18rJVqyua5bKdM8udQtH0Zzx_vTE_e-qqNItzGHzgvL5rAwQMEQ/s1600/1.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1whQ4Z4kiP07ij8Oloa5Rq4Mvdwm2QXuZOl7hYfmcsvzU9NwWwQVi2_lCDXrkSUx7HLp43CfNRXffmhlZkUrwEB2w18rJVqyua5bKdM8udQtH0Zzx_vTE_e-qqNItzGHzgvL5rAwQMEQ/s72-c/1.png
Online Blogger Tricks | A2Z Art of Blogging
https://a4abidaziz.blogspot.com/2016/05/gpa-and-cgpa-calculator-using-c-how-to.html
https://a4abidaziz.blogspot.com/
http://a4abidaziz.blogspot.com/
http://a4abidaziz.blogspot.com/2016/05/gpa-and-cgpa-calculator-using-c-how-to.html
true
1578912806520322323
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy