I have an assignment for programming that is actually pretty easy, if it were not for this error:
"Warning C4244: '+=' : conversion from 'double' to 'float', possible loss of data."

note: I MUST use float for result and rate, and int for duration.

For some reason, I'm allowed to do this
Code:
float result,rate;
int duration;

cin>>rate; 
cin>>duration;
result=rate*duration;
result+=rate*duration;
But I'm not allowed to do this
Code:
for(int i=0;i<slot;i++)
{
	gross[i]=rate[i]* hours[i];
	if (hours[i]>40) gross[i]+=.5*(hours[i]-rate[i]); //Error here
	}
//the error is loss of data due to conversion from double to float
//declared datatypes:
//float: gross, rate
//int: rate
Thanks ^^