Hello i need help i have to read in a file , but one of the tokens in the file is either yes or no depending on if the vehicle has air con or not.
how do i change the boolean field to true if it is yes and no to false ???.
public void readData(Scanner scanner)
{
group = scanner.next();
vehID = scanner.next();
regNo = scanner.next();
make = scanner.next();
model = scanner.next();
if(scanner.next().equals("yes"))
{
airCon = true; // where it has to be yes or no
}
engineSize = scanner.nextDouble();
fuelType = scanner.next();
gearbox = scanner.next();
transmission = scanner.next();
mileage = scanner.nextInt();
dateFirstRegistered = scanner.next();
}