My project on student grade

#include<iostream>
#include<sstream>
using namespace std;

struct gpa
{

string nme,marks,subcode,subnme,grade;
int credit;
double gpa;
}student;

double pointcal(string grade);
double calculate_gpa(double);
int print(gpa student);

int main()
{
string grade,mystr;
int credit;


cout << "\nENTER NAME: ";
getline(cin,student.nme);
cout << "ENTER TOTAL NUMBER: ";
getline(cin,student.marks);

cout<<"\nENTER GRADE FOR THE FOLLOWING SUBJECT:-"<<endl;

cout<<" CS101: INTRODUCTION TO CP: ";
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

cout<<" CS102: FUNDAMENTALS OF ALGORITHM: " ;
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

cout<<" CS103: FUNDAMENTALS OF DATABASE SYSTEMS: ";
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

cout<<" CS104: DISCRETE STRUCTURE: ";
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

cout<<" CS105: WEB PROGRAMMING: ";
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

cout<<" CS106: ENGLISH COMPREHENSION: ";
getline(cin,student.grade);
cout<<"SUBJECT CREDIT :";
getline(cin,mystr);
stringstream(mystr)>>student.credit;

double pointcal(string grade);
double calculate_gpa(double);
int print(gpa student);


}

double pointcal(string grade)
{


if (grade=="A")
return 4.0;

else if(grade=="A-")
return 3.75;

else if(grade=="B+")
return 3.5;

else if(grade=="B")
return 3.25;

else if(grade=="B-")
return 3.0;

else if(grade=="C+")
return 2.75;

else if(grade=="C")
return 2.5;

else if(grade=="C-")
return 2.25;

else if(grade=="D")
return 2.0;

else if(grade=="E")
return 1.5;

else if(grade=="F")
return 1.25;

else
return 0;
}

double calculate_gpa(double gpa_s)
{
double subg,pointer,totals,totalc;
string grade;
int credit;

subg=pointcal(grade)*credit;
totals=totals+subg;
totalc=totalc+credit;
gpa_s=totals/totalc;

cout<<"GPA :"<<gpa_s;

return gpa_s;

}

int print(gpa student)
{
cout << "\nNAME: "<<student.nme;
cout << "TOTAL NUMBER: "<<cin,student.matric;

cout<<"\n CS101: INTRODUCTION TO CP: "<<student.grade;
cout<<"\n CS102: FUNDAMENTALS OF ALGORITHM:"<<student.grade ;
cout<<"\n CS103: FUNDAMENTALS OF DATABASE SYSTEMS:"<<student.grade;
cout<<"\n CS104: DISCRETE STRUCTURE: "<<student.grade;
cout<<"\n CS105: WEB PROGRAMMING: "<<student.grade;
cout<<"\n CS106: ENGLISH COMPREHENSION: "<<student.grade;

}


Kindly, help me with this as i dont get an output and my screen closes if i run the program it not executes fully....
At the bottom of main you have:

1
2
3
   double pointcal(string grade);
   double calculate_gpa(double);
   int print(gpa student);


These are function declarations. I suspect you actually meant to call the functions, so you might want to go over your material on using functions again.

http://www.cplusplus.com/doc/tutorial/functions/
ok, i got it i have to learn that but if you can favour me and just correct the code for me.
Topic archived. No new replies allowed.