VoterDriver.java
// Main file for the VoterDriver class 

Main file for the VoterDriver class
Main file for the VoterDriver class
public static void main(String[] args) {
	       ArrayList<Voter> voters = new ArrayList<>(10);
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       voters.add(new Voter("Leibowitz",'D'));
	       for(int index = 0; index < voters.size(); index++) {
	           if(voters.get(index).getParty()=='D') {
	               System.out.println("Name:"+voters.get(index).getName() +" Party:"+voters.get(index).getParty());
	           }
	       }
	}
public static void main ( String [ ] args ) { ArrayList < Voter > voters = new ArrayList < > ( 10 ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; voters . add ( new Voter ( "Leibowitz" , 'D' ) ) ; for ( int index = 0 ; index < voters . size ( ) ; index ++ ) { if ( voters . get ( index ) . getParty ( ) == 'D' ) { System . out . println ( "Name:" + voters . get ( index ) . getName ( ) + " Party:" + voters . get ( index ) . getParty ( ) ) ; } } }
Main file for the VoterDriver class
Main file for the VoterDriver class
// TODO Auto-generated method stub
 //ArrayList of voters
 // Adds 10 voters to array list
 //For loop that prints the array 10 times 
