class StudentMarks
{
public:
int Marks;
StudentMarks();
StudentMarks(int iMarks);
char grade();
};
#include"grade.h"
#include<iostream>
using namespace std;
StudentMarks::StudentMarks(int)
{
int iMarks=0;
}
/*StudentMark::StudentMark(int iStudentNewmark)
{
iStudentmark=iStudentNewmark;*/
char StudentMarks::getgrade()
{
if(iMarks>=80 && iMarks<=100)
{
return 'A';
}
else
if(iMarks>=75 && iMarks<80)
{
return 'A-';
}
else
if(iMarks>=70 && iMarks<75)
{
return 'B+';
}
else
if(iMarks>=65 && iMarks<70)
{
return 'B';
}
else
if(iMarks>=60 && iMarks<65)
{
return 'B-';
}
else
if(iMarks>=55 && iMarks<60)
{
return 'C+';
}
else
if(iMarks>=50 && iMarks<55)
{
return 'C';
}
else
if(iMarks>=45 && iMarks<50)
{
return 'c-';
}
else
if(iMarks>=40 && iMarks<45)
{
return 'D';
}
else
if(iMarks>=0&& iMarks<40)
{
return 'F';
}
}
#include<iostream>
#include"grade.h"
#include<stdlib.h>
using namespace std;
int main()
{
StudentMarks StudentMarks1(65);
StudentMarks StudentMarks2(75);
StudentMarks StudentMarks3(89);
cout<<"your marks is"<<StudentMarks1.iMarks<<" your Grade is"<< StudentMarks1.getgrade()<<endl;
cout<<"your marks is"<<StudentMarks2.iMarks<<" your Grade is"<< StudentMarks2.getgrade()<<endl;
cout<<"your marks is"<<StudentMarks3.iMarks<<" your Grade is"<< StudentMarks3.getgrade()<<endl;
return 0;
}
why my output is like this your marks is 65 your grade is p
who can explain to me...how to correct it