Can someone help me figure out how to print the number of smoker and number of nonsmoker?
//This is the demo for Policy Class
import java.util.*;
import java.io.*;
public class Policy
{
public static void main(String[] args) throws IOException
{
//Create a instance of the File class
File policyFile = new File("PolicyInformation.txt"); //Open File Text
//Pass a reference to the File object as an argument to the Scanner class constructor
Scanner inputFile = new Scanner(policyFile);
//Declaring Variables
int policyNumber = 0;
String providerName = "";
String firstName = "";
String lastName = "";
int holderAge = 0;
String smokingStatus = "";
double holderHeight = 0.0;
double holderWeight = 0.0;
double holderBmi = 0.0;
double policyPrice = 0.0;
//Create an array list to store objects. The ArrayList will hold Policy objects
ArrayList<Policy> policies = new ArrayList<Policy>();
//While loop to read the file
while(inputFile.hasNext())
{
//Reads data from file
policyNumber = inputFile.nextInt();
inputFile.nextLine();
providerName = inputFile.nextLine();
firstName = inputFile.nextLine();
lastName = inputFile.nextLine();
holderAge = inputFile.nextInt();
inputFile.nextLine();
smokingStatus = inputFile.nextLine();
holderHeight = inputFile.nextDouble();
inputFile.nextLine();
holderWeight = inputFile.nextDouble();
inputFile.nextLine();
//Create Policy Objects using the Policy Class type
Policy p = new Policy(policyNumber, providerName, firstName, lastName, holderAge, smokingStatus, holderHeight, holderWeight);
//Add Policy Objects to the ArrayList
policies.add(p);
}//end while loop
//For Loop to display the following output for Policy Class
for(int i = 0; i < policies.size(); i++)
{
//Displaying the following information for the Policy Class
System.out.printf("\nPolicy Number: %.0f ", policies.get(i).getpolicyNumber());
System.out.println("\nProvider Name: " + policies.get(i).getproviderName());
System.out.println("Policyholder's First Name: " + policies.get(i).getfirstName());
System.out.println("Policyholder's Last Name: " + policies.get(i).getlastName());
System.out.println("Policyholder's Age: " + policies.get(i).getholderAge());
System.out.println("Policyholder's Smoking Status(smoker/non-smoker): " + policies.get(i).getsmokingStatus());
System.out.println("Policyholder's Height: " + policies.get(i).getholderHeight() + " inches");
System.out.println("Policyholder's Weight: " + policies.get(i).getholderWeight() + " pounds");
System.out.printf("Policyholder's BMI: %.2f", policies.get(i).getholderBmi());
System.out.printf("\nPolicy Price: $%.2f", policies.get(i).getpolicyPrice());
//Blankline between the policies and numSmoker/numNonsmoker
System.out.println();
}//end for loop
//Close File
inputFile.close();
//Display the number of Policyholders that are smokers and the number of Policyholders that are non-smokers.
System.out.println("\nThe number of policies with a smoker: ");
System.out.println("The number of policies with a nonsmoker: ");
}//end main
}//end class