Code:
import java.util.Scanner;
import java.io.*;
public class Lab06A
{
private String name;
private int age;
private int year;
public static void main(String[]args)
{
Lab06A = new Lab06A();
lab.input();
lab.process();
lab.output();
}
public void input()
{
try
{
Scanner reader = new Scanner(new File("lab06a.dat"));
name = reader.next();
reader.useDelimiter("/|\r\n");
age = reader.nextInt();
}
catch (FileNotFoundException e )
{
System.out.println("Error opening data file!");
System.exit(0);
}
}
public void process()
{
year = 2012-age;
}
public void output()
{
System.out.println(name+"you were born in"+year);
}
}
It tells me it cannot find the symbol.
Comment