I have a question on how to extract letters from File. This is an example line from the file I read.
ui Parker 8
I read 3 tokens and am supposed to extract 2 letters from the first token but not sure how to do it. The code references 5 attributes which are part of an object that was declared earlier and 3 tokens in the file. The first letter determines if the student is undergraduate or graduate and the second letter determines if the student is instate or out of state.
while(fileScan.hasNext())
{
classStatus = fileScan.next();
if(classStatus.charAt(0) == 'u' || classStatus.charAt(0) == 'U')
{
classStatus= "underGrad";
}
else
{
classStatus= "Grad";
}
studentName = fileScan.next();
resident = fileScan.next();
numberOfCredits = fileScan.nextInt();
double tuitionBill = fileScan.nextDouble();
StudentNode aNode = new StudentNode(classStatus,studentName,resident);