I'm getting errors while compiling this. Can someone point me in the right direction?
import java.util.Scanner;
public class MaleFemaleGPA
{
static Scanner inFile = new Scanner(new FileReader(GPAdata.dat));
public static void main(String[] args)
{
char maleTotal, femaleTotal;
int maleCount, femaleCount;
double maleAverage, femaleAverage;
if (inFile.next.charAt(0) = m)
{
maleTotal += inFile.nextDouble();
maleCount++;
}
else
{
femaleTotal += inFile.nextDouble();
femaleCount++;
}
maleAverage = maleTotal / maleCount;
femaleAverage = femaleTotal / femaleCount;
System.out.println("Average GPA for male students is " + maleAverage);
System.out.println("Average GPA for female students is " + femaleAverage);
inFile.close();
}
}