Cant find the error

I just want the program to show me the quality points but when I compile it it says "[Linker Error] undefined reference to 'getGradeInfo(int&, char&, int&, char&)'Id returned 1 exit status." I have no idea what this means or why I'm getting it. This is my code.



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

void getGradeInfo(int& c1credits, char& c1grade, int& c2credits, char& c2grade);
int getQualityPoints(int c1credits,char& c1grade,char& c2grade,int c2credits);
void computeGPA(int c1credits,char c1grade,int c2credits,char c2grade,int& qpl1,int& qpl2,double gpa);
void printReport(int c1credits,char c1grade,int c2credits,char c2grade,int qpl1,int qpl2,double gpa);

int main()
{
int c1credits, c2credits, qpl1, qpl2;
double gpa;
char c1grade, c2grade;

getGradeInfo(c1credits, c1grade, c2credits, c2grade);
//getQualityPoints(c1credits,c1grade,qpl1,qpl2,c2grade,c2credits);
computeGPA(c1credits, c1grade, c2credits, c2grade, qpl1, qpl2, gpa);
printReport(c1credits, c1grade, c2credits, c2grade, qpl1, qpl2, gpa);

system("PAUSE");
return 0;
}//end of main

void getGradeInfo(int& c1credits, int& c1grade, int& c2credits, int& c2grade)
{
cout<<"Enter the # of credits and your grade for class #1 "<<endl;
cin>>c1credits,c1grade;
cout<<"Enter the # of credits and your grade for class #2 "<<endl;
cin>>c2credits,c2grade;

}
int getQualityPoints(int c1credits,char& c1grade,char& c2grade,int c2credits)
{

if(c1grade='A')
c1grade=4;
else if(c1grade='B')
c1grade=3;
else if(c1grade='C')
c1grade=2;
else if(c1grade='D')
c1grade=1;
else
c1grade=0;
return c1grade;
}
void computeGPA(int c1credits,char c1grade,int c2credits,char c2grade,int& qpl1,int& qpl2,double gpa)
{

qpl1=c1credits*getQualityPoints(c1grade);

}
void printReport(int c1credits,char c1grade,int c2credits,char c2grade,int qpl1,int qpl2,double gpa)
{
cout<<"quality points "<<qpl1<<endl;
}
1
2
3
4
5
6
7
void getGradeInfo(int& c1credits, int& c1grade, int& c2credits, int& c2grade)
{
cout<<"Enter the # of credits and your grade for class #1 "<<endl;
cin>>c1credits,c1grade;
cout<<"Enter the # of credits and your grade for class #2 "<<endl;
cin>>c2credits,c2grade;
}


check out cin's again...
cin >> some_variable >> some_variable2;

colon is not the answer you see
I fixed the cin statements but I still get the same error message.
void getGradeInfo(int& c1credits, int& c1grade, int& c2credits, int& c2grade)

void getGradeInfo(int& c1credits, char& c1grade, int& c2credits, char& c2grade);

Your formal paramter lists are different.
In the future, be sure to post your code in code tags. That way, your code will appear like it does in this post.
Last edited on
thank you both very much. I don't know how I missed those errors.
That is called learning... Even professional programmers don't see them errors; unfortunately

(not 1 of those, just hobbyist)
Topic archived. No new replies allowed.