No operator ">" matches these operands

I can't figure out why do i have this error.this error was produced after i entered "assert". any help will be appriciated.Thank you.

#include"stdafx.h"
#include<assert.h>
#include<iostream>
#include<string>
using namespace std;

//Functions.
string tmpscore (double x);
void displaymessage ();

//main function with Data call and Loop statements.
int main()
{
//Answer Key.
string answer="abcdefabcdefabcdefab";

int i=0;
double max=0.0,min=100.0,sum=0.0;

//Variables
int student_num;
cout<<"Please enter number of students to be graded :";
cin>>student_num;
cout<<"For each of the following students,enter the StudentID and answer details :"<<endl;

//Student ID and Answer Input
while(i<student_num)
{

cout<<"Student "<<i+1<<" : ";
string StudentID;
cin>>StudentID;

assert (StudentID > 0);

cout <<"Student's Answers:";
string input;
cin>>input;


// Student ID Verifier.
while(1)
{
if(StudentID.size()==7)
{
int j;
for(j=0;j<StudentID.size();j++)
{
if(StudentID[j] >= '0' && StudentID[j] <='9') ;
else break;
}

if(j==StudentID.size()) break;
else
{
//Function call.
displaymessage();
cin>>StudentID;
cout<<"Please re-enter student's answers:";
cin>>input;
}
}

else
{

cout<<"ERROR in the studentID number.\nPlease re-enter student ID number for student "<<i+1<<" :";
cin>>StudentID;
cout<<"Please re-enter student's answers:";
cin>>input;
}
}


// Percentage and Grade calculator.
int correct=0;
for(int j=0;j<input.size() && j<answer.size();j++)
{

if(input[j]==answer[j]) correct++;
}

double score;
score=(double)correct/(double)answer.size();
score=score*100;

//Cout with Function call.Outputs Grade.
cout<<" Score "<<score<<"% "<<tmpscore(score)<<endl;

//Maximum and Minimum score calculator.
if(score > max )
max=score;
if(score < min )
min=score;
sum = sum+score;
i++;
}

//Statistics, Average score calulator and min,max outputter.
cout<<"Statistics:"<<endl;
cout<<" Average score = "<<sum/student_num<<endl;
cout<<" Maximum score = "<<max<<endl;
cout<<" Minimum score = "<<min<<"%"<<endl;

system("pause");
return 0;
}

// Grade caller. Funtion
string tmpscore(double x)
{
if(x>=90)
cout<<"grade = A "<<endl;
else if(x >=80 && x <90)
cout<<"grade = B "<<endl;
else if(x >=70 && x <80)
cout<<"grade = C "<<endl;
else if(x >=60 && x <70)
cout<<"grade = D "<<endl;
else if(x >=50 && x <60)
cout<<"grade = E "<<endl;
else if(x < 50 )
return "grade = F ";

}
void displaymessage ()
{
int i=0;
cout<<"ERROR: The student ID is invalid. Please re-enter student ID number.";
cout<<"\nStudent "<<i+1<<""" ID: ";
}


StudentID is a string, not a number. Why is it a string if you want to treat it as a number?
Topic archived. No new replies allowed.