src/main/java/edu/bu/met/cs665/HeaderPackage/NewCustomerHeader.java
/**
     * This method generates a random name to use
     * in the email header. the names are saved
     * in a text file
     * @exception IOException
     */
This method generates a random name to use
in the email header. the names are saved
in a text file
@exception IOException
This method generates a random name to use in the email header . the names are saved in a text file @exception IOException
@Override
    public void generateNames() throws IOException {
        ArrayList<String> result = new ArrayList<>();
        Random r = new Random();
        try (Scanner s = new Scanner(new FileReader("src\\main\\java\\edu\\bu\\met\\cs665\\HeaderPackage\\HRTeam"))) {
            while (s.hasNext()) {
                result.add(s.nextLine());
            }
            int randomIndex = (int) (Math.random() * result.size());
            String randomName = result.get(randomIndex);
            System.out.println(randomName);
        }
    }
@ Override public void generateNames ( ) throws IOException { ArrayList < String > result = new ArrayList < > ( ) ; Random r = new Random ( ) ; try ( Scanner s = new Scanner ( new FileReader ( "src\\main\\java\\edu\\bu\\met\\cs665\\HeaderPackage\\HRTeam" ) ) ) { while ( s . hasNext ( ) ) { result . add ( s . nextLine ( ) ) ; } int randomIndex = ( int ) ( Math . random ( ) * result . size ( ) ) ; String randomName = result . get ( randomIndex ) ; System . out . println ( randomName ) ; } }
This method generates a random name to use
 in the email header.
This method generates a random name to use in the email header .
//C:\Users\Asiya Ahmed\IdeaProjects\AllThingsArrays\src\Magac\Names // Pick one at random // Output the result