Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

------- SUMMARY ------- Write a C++ program that (1) opens a file for output, an

ID: 3637410 • Letter: #

Question

-------
SUMMARY
-------

Write a C++ program that (1) opens a file for output, and (2) writes surnames
(last names) to it.

Call your program "surnames."

----------------------------------
GRADING RUBRIC FOR THIS ASSIGNMENT
----------------------------------

Read the document entitled "GRADING GUIDELINES FOR ALL ASSIGNMENTS."

-----------------------------------
DETAILS, REQUIREMENTS, RESTRICTIONS
-----------------------------------

Use the random number generator, built into C++, to select the names from a list
of surnames that are in an array, see the resources below.

Remember, first seed the RNG, then you generate numbers with it.

Here is some code for that purpose --- you will need to adjust it to suit your
needs.

#include <time.h> // For the time() function

// ...
// ...
//
// Some lines of code ...
//
// ...
// ...

// Initialize the RNG with a seed supplied by the system clock, do this
// once, at startup
srand ( time(NULL) );

// ...
// ...
//
// Some lines of code ...
//
// ...
// ...

// Generate a random index in the range (0,25)
int i = rand() % 26;

The output file is to be named "name_l.txt" (all lowercase letters) and should
be opened in the current directory.

The user-interface for the program shall consist of a menu, a question and any
necessary error messages.

There is an example program included in the resources for this assignment, which
can be run for guidance.

The top-level menu shall ask the user if the s/he wants to write a collection
of last names to a file, or wants to quit the program.

If the user chooses to continue, the program shall then ask how many last names
to generate.

The user shall not be allowed to pick a number that is less than 40.

The user shall not be allowed to pick a number that is greater than 80.

The user shall be given three chances to enter a correct number.

If s/he fails on all three tries, the program will issue an appropriate error
message and exit with a appropriate exit code that is greater than zero.

In general, for any error that occurs, the program shall detect it and take the
appropriate action.

For example, if the output file cannot be opened, the program shall alert the
user and exit the program with a appropriate exit code (that is greater than
zero).

As another example, if the user specifies an incorrect number of names to
generate, say 110, the program shall alert the user and give her/him an
opportunity to correct it, up to three times, as described above.

There may be other errors that can occur, and the program shall handle those in
a similar fashion.

Duplication of names in the program's output is okay, and is to be expected for
this program --- that condition is normal, not an error.

It is the job of the programmer, as the designer of the program, to determine
all the pitfalls that can occur and take appropriate actions for each.

If the program runs to completion without error, it shall return (to the
operating system) an exit code of zero (0), which signifies successful
compeletion.

In either case, success or failure, before the programs exits, it shall close
the output file --- unless it was never opened to begin with.

-------------------
CODING RESTRICTIONS
-------------------

Do not use the string class for this program.

Use character arrays instead.

-------------------------------------------------
GENERAL CAVEAT CONCERNING THE USE OF CODE SAMPLES
-------------------------------------------------

For this program, you may use code from any of the example programs that were
presented in class prior to this assignment being assigned, but if you choose
to use code from in-class examples, it is your responsibility to make sure that
code works --- do not assume that code presented in class does what you need to
do or is bug-free.

No such guarantee is made or implied for programs that are presented in class or
through the online web site for this course.

--------------------------------------------
SPECIAL NOTE REGARDING THE SIZE OF THE ARRAY
--------------------------------------------

The last names shall be chosen randomly from the array given below.

You will need to know the size of that array (i.e., the number of elements
stored in it).

Q: Why do you need to know the size of the array?
A: To produce random indexes in the correct range.

You may also notice that the declaration of the array does not give this
information.

char * names_last [] = ...

To determine the size of the array, use sizeof (unless you want to count the
number of elements manually).

Here is a code fragment you can directly use to determine how many elements are
in the array.

int array_size = sizeof ( names_last ) / sizeof ( names_last [0] );

Be careful if you want to apply this code technique to future programs, because
this method does not work if the array is allocated dynamically.

---------
RESOURCES
---------

Check the online web site for this course for a resources folder for this
assignment.

Here is the array of surnames --- you must copy the array into your program.

char * names_last [] =
{
"Abbott",
"Acevedo",
"Acosta",
"Adams",
"Adkins",
"Aguilar",
"Aguirre",
"Albert",
"Alexander",
"Alford",
"Allen",
"Allison",
"Alston",
"Alvarado",
"Alvarez",
"Anderson",
"Andrews",
"Anthony",
"Armstrong",
"Arnold",
"Ashley",
"Atkins",
"Atkinson",
"Austin",
"Avery",
"Avila",
"Ayala",
"Ayers",
"Bailey",
"Baird",
"Baker",
"Baldwin",
"Ball",
"Ballard",
"Banks",
"Barber",
"Barker",
"Barlow",
"Barnes",
"Barnett",
"Barr",
"Barrera",
"Barrett",
"Barron",
"Barry",
"Bartlett",
"Barton",
"Bass",
"Bates",
"Battle",
"Bauer",
"Baxter",
"Beach",
"Bean",
"Beard",
"Beasley",
"Beck",
"Becker",
"Bell",
"Bender",
"Benjamin",
"Bennett",
"Benson",
"Bentley",
"Benton",
"Berg",
"Berger",
"Bernard",
"Berry",
"Best",
"Bird",
"Bishop",
"Black",
"Blackburn",
"Blackwell",
"Blair",
"Blake",
"Blanchard",
"Blankenship",
"Blevins",
"Bolton",
"Bond",
"Bonner",
"Booker",
"Boone",
"Booth",
"Bowen",
"Bowers",
"Bowman",
"Boyd",
"Boyer",
"Boyle",
"Bradford",
"Bradley",
"Bradshaw",
"Brady",
"Branch",
"Bray",
"Brennan",
"Brewer",
"Bridges",
"Briggs",
"Bright",
"Britt",
"Brock",
"Brooks",
"Brown",
"Browning",
"Bruce",
"Bryan",
"Bryant",
"Buchanan",
"Buck",
"Buckley",
"Buckner",
"Bullock",
"Burch",
"Burgess",
"Burke",
"Burks",
"Burnett",
"Burns",
"Burris",
"Burt",
"Burton",
"Bush",
"Butler",
"Byers",
"Byrd",
"Cabrera",
"Cain",
"Calderon",
"Caldwell",
"Calhoun",
"Callahan",
"Camacho",
"Cameron",
"Campbell",
"Campos",
"Cannon",
"Cantrell",
"Cantu",
"Cardenas",
"Carey",
"Carlson",
"Carney",
"Carpenter",
"Carr",
"Carrillo",
"Carroll",
"Carson",
"Carter",
"Carver",
"Case",
"Casey",
"Cash",
"Castaneda",
"Castillo",
"Castro",
"Cervantes",
"Chambers",
"Chan",
"Chandler",
"Chaney",
"Chang",
"Chapman",
"Charles",
"Chase",
"Chavez",
"Chen",
"Cherry",
"Christensen",
"Christian",
"Church",
"Clark",
"Clarke",
"Clay",
"Clayton",
"Clements",
"Clemons",
"Cleveland",
"Cline",
"Cobb",
"Cochran",
"Coffey",
"Cohen",
"Cole",
"Coleman",
"Collier",
"Collins",
"Colon",
"Combs",
"Compton",
"Conley",
"Conner",
"Conrad",
"Contreras",
"Conway",
"Cook",
"Cooke",
"Cooley",
"Cooper",
"Copeland",
"Cortez",
"Cote",
"Cotton",
"Cox",
"Craft",
"Craig",
"Crane",
"Crawford",
"Crosby",
"Cross",
"Cruz",
"Cummings",
"Cunningham",
"Curry",
"Curtis",
"Dale",
"Dalton",
"Daniel",
"Daniels",
"Daugherty",
"Davenport",
"David",
"Davidson",
"Davis",
"Dawson",
"Day",
"Dean",
"Decker",
"Dejesus",
"Delacruz",
"Delaney",
"Deleon",
"Delgado",
"Dennis",
"Diaz",
"Dickerson",
"Dickson",
"Dillard",
"Dillon",
"Dixon",
"Dodson",
"Dominguez",
"Donaldson",
"Donovan",
"Dorsey",
"Dotson",
"Douglas",
"Downs",
"Doyle",
"Drake",
"Dudley",
"Duffy",
"Duke",
"Duncan",
"Dunlap",
"Dunn",
"Duran",
"Durham",
"Dyer",
"Eaton",
"Edwards",
"Elliott",
"Ellis",
"Ellison",
"Emerson",
"England",
"English",
"Erickson",
"Espinoza",
"Estes",
"Estrada",
"Evans",
"Everett",
"Ewing",
"Farley",
"Farmer",
"Farrell",
"Faulkner",
"Ferguson",
"Fernandez",
"Ferrell",
"Fields",
"Figueroa",
"Finch",
"Finley",
"Fischer",
"Fisher",
"Fitzgerald",
"Fitzpatrick",
"Fleming",
"Fletcher",
"Flores",
"Flowers",
"Floyd",
"Flynn",
"Foley",
"Forbes",
"Ford",
"Foreman",
"Foster",
"Fowler",
"Fox",
"Francis",
"Franco",
"Frank",
"Franklin",
"Franks",
"Frazier",
"Frederick",
"Freeman",
"French",
"Frost",
"Fry",
"Frye",
"Fuentes",
"Fuller",
"Fulton",
"Gaines",
"Gallagher",
"Gallegos",
"Galloway",
"Gamble",
"Garcia",
"Gardner",
"Garner",
"Garrett",
"Garrison",
"Garza",
"Gates",
"Gay",
"Gentry",
"George",
"Gibbs",
"Gibson",
"Gilbert",
"Giles",
"Gill",
"Gillespie",
"Gilliam",
"Gilmore",
"Glass",
"Glenn",
"Glover",
"Goff",
"Golden",
"Gomez",
"Gonzales",
"Gonzalez",
"Good",
"Goodman",
"Goodwin",
"Gordon",
"Gould",
"Graham",
"Grant",
"Graves",
"Gray",
"Green",
"Greene",
"Greer",
"Gregory",
"Griffin",
"Griffith",
"Grimes",
"Gross",
"Guerra",
"Guerrero",
"Guthrie",
"Gutierrez",
"Guy",
"Guzman",
"Hahn",
"Hale",
"Haley",
"Hall",
"Hamilton",
"Hammond",
"Hampton",
"Hancock",
"Haney",
"Hansen",
"Hanson",
"Hardin",
"Harding",
"Hardy",
"Harmon",
"Harper",
"Harrell",
"Harrington",
"Harris",
"Harrison",
"Hart",
"Hartman",
"Harvey",
"Hatfield",
"Hawkins",
"Hayden",
"Hayes",
"Haynes",
"Hays",
"Head",
"Heath",
"Hebert",
"Henderson",
"Hendricks",
"Hendrix",
"Henry",
"Hensley",
"Henson",
"Herman",
"Hernandez",
"Herrera",
"Herring",
"Hess",
"Hester",
"Hewitt",
"Hickman",
"Hicks",
"Higgins",
"Hill",
"Hines",
"Hinton",
"Hobbs",
"Hodge",
"Hodges",
"Hoffman",
"Hogan",
"Holcomb",
"Holden",
"Holder",
"Holland",
"Holloway",
"Holman",
"Holmes",
"Holt",
"Hood",
"Hooper",
"Hoover",
"Hopkins",
"Hopper",
"Horn",
"Horne",
"Horton",
"House",
"Houston",
"Howard",
"Howe",
"Howell",
"Hubbard",
"Huber",
"Hudson",
"Huff",
"Huffman",
"Hughes",
"Hull",
"Humphrey",
"Hunt",
"Hunter",
"Hurley",
"Hurst",
"Hutchinson",
"Hyde",
"Ingram",
"Irwin",
"Jackson",
"Jacobs",
"Jacobson",
"James",
"Jarvis",
"Jefferson",
"Jenkins",
"Jennings",
"Jensen",
"Jimenez",
"Johns",
"Johnson",
"Johnston",
"Jones",
"Jordan",
"Joseph",
"Joyce",
"Joyner",
"Juarez",
"Justice",
"Kane",
"Kaufman",
"Keith",
"Keller",
"Kelley",
"Kelly",
"Kemp",
"Kennedy",
"Kent",
"Kerr",
"Key",
"Kidd",
"Kim",
"King",
"Kinney",
"Kirby",
"Kirk",
"Kirkland",
"Klein",
"Kline",
"Knapp",
"Knight",
"Knowles",
"Knox",
"Koch",
"Kramer",
"Lamb",
"Lambert",
"Lancaster",
"Landry",
"Lane",
"Lang",
"Langley",
"Lara",
"Larsen",
"Larson",
"Lawrence",
"Lawson",
"Le",
"Leach",
"Leblanc",
"Lee",
"Leon",
"Leonard",
"Lester",
"Levine",
"Levy",
"Lewis",
"Lindsay",
"Lindsey",
"Little",
"Livingston",
"Lloyd",
"Logan",
"Long",
"Lopez",
"Lott",
"Love",
"Lowe",
"Lowery",
"Lucas",
"Luna",
"Lynch",
"Lynn",
"Lyons",
"Macdonald",
"Macias",
"Mack",
"Madden",
"Maddox",
"Maldonado",
"Malone",
"Mann",
"Manning",
"Marks",
"Marquez",
"Marsh",
"Marshall",
"Martin",
"Martinez",
"Mason",
"Massey",
"Mathews",
"Mathis",
"Matthews",
"Maxwell",
"May",
"Mayer",
"Maynard",
"Mayo",
"Mays",
"Mcbride",
"Mccall",
"Mccarthy",
"Mccarty",
"Mcclain",
"Mcclure",
"Mcconnell",
"Mccormick",
"Mccoy",
"Mccray",
"Mccullough",
"Mcdaniel",
"Mcdonald",
"Mcdowell",
"Mcfadden",
"Mcfarland",
"Mcgee",
"Mcgowan",
"Mcguire",
"Mcintosh",
"Mcintyre",
"Mckay",
"Mckee",
"Mckenzie",
"Mckinney",
"Mcknight",
"Mclaughlin",
"Mclean",
"Mcleod",
"Mcmahon",
"Mcmillan",
"Mcneil",
"Mcpherson",
"Meadows",
"Medina",
"Mejia",
"Melendez",
"Melton",
"Mendez",
"Mendoza",
"Mercado",
"Mercer",
"Merrill",
"Merritt",
"Meyer",
"Meyers",
"Michael",
"Middleton",
"Miles",
"Miller",
"Mills",
"Miranda",
"Mitchell",
"Molina",
"Monroe",
"Montgomery",
"Montoya",
"Moody",
"Moon",
"Mooney",
"Moore",
"Morales",
"Moran",
"Moreno",
"Morgan",
"Morin",
"Morris",
"Morrison",
"Morrow",
"Morse",
"Morton",
"Moses",
"Mosley",
"Moss",
"Mueller",
"Mullen",
"Mullins",
"Munoz",
"Murphy",
"Murray",
"Myers",
"Nash",
"Navarro",
"Neal",
"Nelson",
"Newman",
"Newton",
"Nguyen",
"Nichols",
"Nicholson",
"Nielsen",
"Nieves",
"Nixon",
"Noble",
"Noel",
"Nolan",
"Norman",
"Norris",
"Norton",
"Nunez",
"Obrien",
"Ochoa",
"Oconnor",
"Odom",
"Odonnell",
"Oliver",
"Olsen",
"Olson",
"Oneal",
"Oneil",
"Oneill",
"Orr",
"Ortega",
"Ortiz",
"Osborn",
"Osborne",
"Owen",
"Owens",
"Pace",
"Pacheco",
"Padilla",
"Page",
"Palmer",
"Park",
"Parker",
"Parks",
"Parrish",
"Parsons",
"Pate",
"Patel",
"Patrick",
"Patterson",
"Patton",
"Paul",
"Payne",
"Pearson",
"Peck",
"Pena",
"Pennington",
"Perez",
"Perkins",
"Perry",
"Peters",
"Petersen",
"Peterson",
"Petty",
"Phelps",
"Phillips",
"Pickett",
"Pierce",
"Pittman",
"Pitts",
"Pollard",
"Poole",
"Pope",
"Porter",
"Potter",
"Potts",
"Powell",
"Powers",
"Pratt",
"Preston",
"Price",
"Prince",
"Pruitt",
"Puckett",
"Pugh",
"Quinn",
"Ramirez",
"Ramos",
"Ramsey",
"Randall",
"Randolph",
"Rasmussen",
"Ratliff",
"Ray",
"Raymond",
"Reed",
"Reese",
"Reeves",
"Reid",
"Reilly",
"Reyes",
"Reynolds",
"Rhodes",
"Rice",
"Rich",
"Richard",
"Richards",
"Richardson",
"Richmond",
"Riddle",
"Riggs",
"Riley",
"Rios",
"Rivas",
"Rivera",
"Rivers",
"Roach",
"Robbins",
"Roberson",
"Roberts",
"Robertson",
"Robinson",
"Robles",
"Rocha",
"Rodgers",
"Rodriguez",
"Rodriquez",
"Rogers",
"Rojas",
"Rollins",
"Roman",
"Romero",
"Rosa",
"Rosales",
"Rosario",
"Rose",
"Ross",
"Roth",
"Rowe",
"Rowland",
"Roy",
"Ruiz",
"Rush",
"Russell",
"Russo",
"Rutledge",
"Ryan",
"Salas",
"Salazar",
"Salinas",
"Sampson",
"Sanchez",
"Sanders",
"Sandoval",
"Sanford",
"Santana",
"Santiago",
"Santos",
"Sargent",
"Saunders",
"Savage",
"Sawyer",
"Schmidt",
"Schneider",
"Schroeder",
"Schultz",
"Schwartz",
"Scott",
"Sears",
"Sellers",
"Serrano",
"Sexton",
"Shaffer",
"Shannon",
"Sharp",
"Sharpe",
"Shaw",
"Shelton",
"Shepard",
"Shepherd",
"Sheppard",
"Sherman",
"Shields",
"Short",
"Silva",
"Simmons",
"Simon",
"Simpson",
"Sims",
"Singleton",
"Skinner",
"Slater",
"Sloan",
"Small",
"Smith",
"Snider",
"Snow",
"Snyder",
"Solis",
"Solomon",
"Sosa",
"Soto",
"Sparks",
"Spears",
"Spence",
"Spencer",
"Stafford",
"Stanley",
"Stanton",
"Stark",
"Steele",
"Stein",
"Stephens",
"Stephenson",
"Stevens",
"Stevenson",
"Stewart",
"Stokes",
"Stone",
"Stout",
"Strickland",
"Strong",
"Stuart",
"Suarez",
"Sullivan",
"Summers",
"Sutton",
"Swanson",
"Sweeney",
"Sweet",
"Sykes",
"Talley",
"Tanner",
"Tate",
"Taylor",
"Terrell",
"Terry",
"Thomas",
"Thompson",
"Thornton",
"Tillman",
"Todd",
"Torres",
"Townsend",
"Tran",
"Travis",
"Trevino",
"Trujillo",
"Tucker",
"Turner",
"Tyler",
"Tyson",
"Underwood",
"Valdez",
"Valencia",
"Valentine",
"Valenzuela",
"Vance",
"Vang",
"Vargas",
"Vasquez",
"Vaughan",
"Vaughn",
"Vazquez",
"Vega",
"Velasquez",
"Velazquez",
"Velez",
"Villarreal",
"Vincent",
"Vinson",
"Wade",
"Wagner",
"Walker",
"Wall",
"Wallace",
"Waller",
"Walls",
"Walsh",
"Walter",
"Walters",
"Walton",
"Ward",
"Ware",
"Warner",
"Warren",
"Washington",
"Waters",
"Watkins",
"Watson",
"Watts",
"Weaver",
"Webb",
"Weber",
"Webster",
"Weeks",
"Weiss",
"Welch",
"Wells",
"West",
"Wheeler",
"Whitaker",
"White",
"Whitehead",
"Whitfield",
"Whitley",
"Whitney",
"Wiggins",
"Wilcox",
"Wilder",
"Wiley",
"Wilkerson",
"Wilkins",
"Wilkinson",
"William",
"Williams",
"Williamson",
"Willis",
"Wilson",
"Winters",
"Wise",
"Witt",
"Wolf",
"Wolfe",
"Wong",
"Wood",
"Woodard",
"Woods",
"Woodward",
"Wooten",
"Workman",
"Wright",
"Wyatt",
"Wynn",
"Yang",
"Yates",
"York",
"Young",
"Zamora",
"Zimmerman"
};
a piece of code to help :
#include <iostream>
#include <fstream>

using namespace std;

// Constants
const int EXIT_CODE___SUCCESS = 0;
const int EXIT_CODE___INVALID_CMD_LINE = 1;

int main (
int argc, // Number of command line arguments
char * argv[] ) // Array of cmd line arguments

{

ofstream outfile;

/*

If too few arguments, show the usage message and exit with an error

*/
if (argc < 2)
{
display_usage_message ( );
exit (EXIT_CODE___INVALID_CMD_LINE);
}

open_output_file ( argv [1], outfile );

/*

If we are here, the output file has been opened and we're ready to go

*/

return EXIT_CODE___SUCCESS;
}

void display_usage_message ( )

{

cout << "USAGE: SURNAMES outfile" << endl;
cout << "DESCRIPTION: Writes a list of surnames to outfile" << endl;
cout << "PARAMETERS: outfile ([d:][path]name[.ext])" << endl;
cout << "EXAMPLES: SURNAMES name_l.txt" << endl;
cout << " SURNAMES c:my_data ame_l.txt" << endl;

}

void open_output_file (
char filename [],
ofstream & outfile )

{

outfile.open ( filename );

/*

If the file cannot be opened, exit with an error

*/
if ( ! outfile.open () )
{
cout << "FATAL ERROR: Cannot open " << filename << " for output" << endl;
exit (EXIT_CODE___CANNOT_OPEN_OUTPUT_FILE);
}

}

Explanation / Answer

#include // For the time() function // ... // ... // // Some lines of code ... // // ... // ... // Initialize the RNG with a seed supplied by the system clock, do this // once, at startup srand ( time(NULL) ); char * names_last [] = { "Abbott", "Acevedo", "Acosta", "Adams", "Adkins", "Aguilar", "Aguirre", "Albert", "Alexander", "Alford", "Allen", "Allison", "Alston", "Alvarado", "Alvarez", "Anderson", "Andrews", "Anthony", "Armstrong", "Arnold", "Ashley", "Atkins", "Atkinson", "Austin", "Avery", "Avila", "Ayala", "Ayers", "Bailey", "Baird", "Baker", "Baldwin", "Ball", "Ballard", "Banks", "Barber", "Barker", "Barlow", "Barnes", "Barnett", "Barr", "Barrera", "Barrett", "Barron", "Barry", "Bartlett", "Barton", "Bass", "Bates", "Battle", "Bauer", "Baxter", "Beach", "Bean", "Beard", "Beasley", "Beck", "Becker", "Bell", "Bender", "Benjamin", "Bennett", "Benson", "Bentley", "Benton", "Berg", "Berger", "Bernard", "Berry", "Best", "Bird", "Bishop", "Black", "Blackburn", "Blackwell", "Blair", "Blake", "Blanchard", "Blankenship", "Blevins", "Bolton", "Bond", "Bonner", "Booker", "Boone", "Booth", "Bowen", "Bowers", "Bowman", "Boyd", "Boyer", "Boyle", "Bradford", "Bradley", "Bradshaw", "Brady", "Branch", "Bray", "Brennan", "Brewer", "Bridges", "Briggs", "Bright", "Britt", "Brock", "Brooks", "Brown", "Browning", "Bruce", "Bryan", "Bryant", "Buchanan", "Buck", "Buckley", "Buckner", "Bullock", "Burch", "Burgess", "Burke", "Burks", "Burnett", "Burns", "Burris", "Burt", "Burton", "Bush", "Butler", "Byers", "Byrd", "Cabrera", "Cain", "Calderon", "Caldwell", "Calhoun", "Callahan", "Camacho", "Cameron", "Campbell", "Campos", "Cannon", "Cantrell", "Cantu", "Cardenas", "Carey", "Carlson", "Carney", "Carpenter", "Carr", "Carrillo", "Carroll", "Carson", "Carter", "Carver", "Case", "Casey", "Cash", "Castaneda", "Castillo", "Castro", "Cervantes", "Chambers", "Chan", "Chandler", "Chaney", "Chang", "Chapman", "Charles", "Chase", "Chavez", "Chen", "Cherry", "Christensen", "Christian", "Church", "Clark", "Clarke", "Clay", "Clayton", "Clements", "Clemons", "Cleveland", "Cline", "Cobb", "Cochran", "Coffey", "Cohen", "Cole", "Coleman", "Collier", "Collins", "Colon", "Combs", "Compton", "Conley", "Conner", "Conrad", "Contreras", "Conway", "Cook", "Cooke", "Cooley", "Cooper", "Copeland", "Cortez", "Cote", "Cotton", "Cox", "Craft", "Craig", "Crane", "Crawford", "Crosby", "Cross", "Cruz", "Cummings", "Cunningham", "Curry", "Curtis", "Dale", "Dalton", "Daniel", "Daniels", "Daugherty", "Davenport", "David", "Davidson", "Davis", "Dawson", "Day", "Dean", "Decker", "Dejesus", "Delacruz", "Delaney", "Deleon", "Delgado", "Dennis", "Diaz", "Dickerson", "Dickson", "Dillard", "Dillon", "Dixon", "Dodson", "Dominguez", "Donaldson", "Donovan", "Dorsey", "Dotson", "Douglas", "Downs", "Doyle", "Drake", "Dudley", "Duffy", "Duke", "Duncan", "Dunlap", "Dunn", "Duran", "Durham", "Dyer", "Eaton", "Edwards", "Elliott", "Ellis", "Ellison", "Emerson", "England", "English", "Erickson", "Espinoza", "Estes", "Estrada", "Evans", "Everett", "Ewing", "Farley", "Farmer", "Farrell", "Faulkner", "Ferguson", "Fernandez", "Ferrell", "Fields", "Figueroa", "Finch", "Finley", "Fischer", "Fisher", "Fitzgerald", "Fitzpatrick", "Fleming", "Fletcher", "Flores", "Flowers", "Floyd", "Flynn", "Foley", "Forbes", "Ford", "Foreman", "Foster", "Fowler", "Fox", "Francis", "Franco", "Frank", "Franklin", "Franks", "Frazier", "Frederick", "Freeman", "French", "Frost", "Fry", "Frye", "Fuentes", "Fuller", "Fulton", "Gaines", "Gallagher", "Gallegos", "Galloway", "Gamble", "Garcia", "Gardner", "Garner", "Garrett", "Garrison", "Garza", "Gates", "Gay", "Gentry", "George", "Gibbs", "Gibson", "Gilbert", "Giles", "Gill", "Gillespie", "Gilliam", "Gilmore", "Glass", "Glenn", "Glover", "Goff", "Golden", "Gomez", "Gonzales", "Gonzalez", "Good", "Goodman", "Goodwin", "Gordon", "Gould", "Graham", "Grant", "Graves", "Gray", "Green", "Greene", "Greer", "Gregory", "Griffin", "Griffith", "Grimes", "Gross", "Guerra", "Guerrero", "Guthrie", "Gutierrez", "Guy", "Guzman", "Hahn", "Hale", "Haley", "Hall", "Hamilton", "Hammond", "Hampton", "Hancock", "Haney", "Hansen", "Hanson", "Hardin", "Harding", "Hardy", "Harmon", "Harper", "Harrell", "Harrington", "Harris", "Harrison", "Hart", "Hartman", "Harvey", "Hatfield", "Hawkins", "Hayden", "Hayes", "Haynes", "Hays", "Head", "Heath", "Hebert", "Henderson", "Hendricks", "Hendrix", "Henry", "Hensley", "Henson", "Herman", "Hernandez", "Herrera", "Herring", "Hess", "Hester", "Hewitt", "Hickman", "Hicks", "Higgins", "Hill", "Hines", "Hinton", "Hobbs", "Hodge", "Hodges", "Hoffman", "Hogan", "Holcomb", "Holden", "Holder", "Holland", "Holloway", "Holman", "Holmes", "Holt", "Hood", "Hooper", "Hoover", "Hopkins", "Hopper", "Horn", "Horne", "Horton", "House", "Houston", "Howard", "Howe", "Howell", "Hubbard", "Huber", "Hudson", "Huff", "Huffman", "Hughes", "Hull", "Humphrey", "Hunt", "Hunter", "Hurley", "Hurst", "Hutchinson", "Hyde", "Ingram", "Irwin", "Jackson", "Jacobs", "Jacobson", "James", "Jarvis", "Jefferson", "Jenkins", "Jennings", "Jensen", "Jimenez", "Johns", "Johnson", "Johnston", "Jones", "Jordan", "Joseph", "Joyce", "Joyner", "Juarez", "Justice", "Kane", "Kaufman", "Keith", "Keller", "Kelley", "Kelly", "Kemp", "Kennedy", "Kent", "Kerr", "Key", "Kidd", "Kim", "King", "Kinney", "Kirby", "Kirk", "Kirkland", "Klein", "Kline", "Knapp", "Knight", "Knowles", "Knox", "Koch", "Kramer", "Lamb", "Lambert", "Lancaster", "Landry", "Lane", "Lang", "Langley", "Lara", "Larsen", "Larson", "Lawrence", "Lawson", "Le", "Leach", "Leblanc", "Lee", "Leon", "Leonard", "Lester", "Levine", "Levy", "Lewis", "Lindsay", "Lindsey", "Little", "Livingston", "Lloyd", "Logan", "Long", "Lopez", "Lott", "Love", "Lowe", "Lowery", "Lucas", "Luna", "Lynch", "Lynn", "Lyons", "Macdonald", "Macias", "Mack", "Madden", "Maddox", "Maldonado", "Malone", "Mann", "Manning", "Marks", "Marquez", "Marsh", "Marshall", "Martin", "Martinez", "Mason", "Massey", "Mathews", "Mathis", "Matthews", "Maxwell", "May", "Mayer", "Maynard", "Mayo", "Mays", "Mcbride", "Mccall", "Mccarthy", "Mccarty", "Mcclain", "Mcclure", "Mcconnell", "Mccormick", "Mccoy", "Mccray", "Mccullough", "Mcdaniel", "Mcdonald", "Mcdowell", "Mcfadden", "Mcfarland", "Mcgee", "Mcgowan", "Mcguire", "Mcintosh", "Mcintyre", "Mckay", "Mckee", "Mckenzie", "Mckinney", "Mcknight", "Mclaughlin", "Mclean", "Mcleod", "Mcmahon", "Mcmillan", "Mcneil", "Mcpherson", "Meadows", "Medina", "Mejia", "Melendez", "Melton", "Mendez", "Mendoza", "Mercado", "Mercer", "Merrill", "Merritt", "Meyer", "Meyers", "Michael", "Middleton", "Miles", "Miller", "Mills", "Miranda", "Mitchell", "Molina", "Monroe", "Montgomery", "Montoya", "Moody", "Moon", "Mooney", "Moore", "Morales", "Moran", "Moreno", "Morgan", "Morin", "Morris", "Morrison", "Morrow", "Morse", "Morton", "Moses", "Mosley", "Moss", "Mueller", "Mullen", "Mullins", "Munoz", "Murphy", "Murray", "Myers", "Nash", "Navarro", "Neal", "Nelson", "Newman", "Newton", "Nguyen", "Nichols", "Nicholson", "Nielsen", "Nieves", "Nixon", "Noble", "Noel", "Nolan", "Norman", "Norris", "Norton", "Nunez", "Obrien", "Ochoa", "Oconnor", "Odom", "Odonnell", "Oliver", "Olsen", "Olson", "Oneal", "Oneil", "Oneill", "Orr", "Ortega", "Ortiz", "Osborn", "Osborne", "Owen", "Owens", "Pace", "Pacheco", "Padilla", "Page", "Palmer", "Park", "Parker", "Parks", "Parrish", "Parsons", "Pate", "Patel", "Patrick", "Patterson", "Patton", "Paul", "Payne", "Pearson", "Peck", "Pena", "Pennington", "Perez", "Perkins", "Perry", "Peters", "Petersen", "Peterson", "Petty", "Phelps", "Phillips", "Pickett", "Pierce", "Pittman", "Pitts", "Pollard", "Poole", "Pope", "Porter", "Potter", "Potts", "Powell", "Powers", "Pratt", "Preston", "Price", "Prince", "Pruitt", "Puckett", "Pugh", "Quinn", "Ramirez", "Ramos", "Ramsey", "Randall", "Randolph", "Rasmussen", "Ratliff", "Ray", "Raymond", "Reed", "Reese", "Reeves", "Reid", "Reilly", "Reyes", "Reynolds", "Rhodes", "Rice", "Rich", "Richard", "Richards", "Richardson", "Richmond", "Riddle", "Riggs", "Riley", "Rios", "Rivas", "Rivera", "Rivers", "Roach", "Robbins", "Roberson", "Roberts", "Robertson", "Robinson", "Robles", "Rocha", "Rodgers", "Rodriguez", "Rodriquez", "Rogers", "Rojas", "Rollins", "Roman", "Romero", "Rosa", "Rosales", "Rosario", "Rose", "Ross", "Roth", "Rowe", "Rowland", "Roy", "Ruiz", "Rush", "Russell", "Russo", "Rutledge", "Ryan", "Salas", "Salazar", "Salinas", "Sampson", "Sanchez", "Sanders", "Sandoval", "Sanford", "Santana", "Santiago", "Santos", "Sargent", "Saunders", "Savage", "Sawyer", "Schmidt", "Schneider", "Schroeder", "Schultz", "Schwartz", "Scott", "Sears", "Sellers", "Serrano", "Sexton", "Shaffer", "Shannon", "Sharp", "Sharpe", "Shaw", "Shelton", "Shepard", "Shepherd", "Sheppard", "Sherman", "Shields", "Short", "Silva", "Simmons", "Simon", "Simpson", "Sims", "Singleton", "Skinner", "Slater", "Sloan", "Small", "Smith", "Snider", "Snow", "Snyder", "Solis", "Solomon", "Sosa", "Soto", "Sparks", "Spears", "Spence", "Spencer", "Stafford", "Stanley", "Stanton", "Stark", "Steele", "Stein", "Stephens", "Stephenson", "Stevens", "Stevenson", "Stewart", "Stokes", "Stone", "Stout", "Strickland", "Strong", "Stuart", "Suarez", "Sullivan", "Summers", "Sutton", "Swanson", "Sweeney", "Sweet", "Sykes", "Talley", "Tanner", "Tate", "Taylor", "Terrell", "Terry", "Thomas", "Thompson", "Thornton", "Tillman", "Todd", "Torres", "Townsend", "Tran", "Travis", "Trevino", "Trujillo", "Tucker", "Turner", "Tyler", "Tyson", "Underwood", "Valdez", "Valencia", "Valentine", "Valenzuela", "Vance", "Vang", "Vargas", "Vasquez", "Vaughan", "Vaughn", "Vazquez", "Vega", "Velasquez", "Velazquez", "Velez", "Villarreal", "Vincent", "Vinson", "Wade", "Wagner", "Walker", "Wall", "Wallace", "Waller", "Walls", "Walsh", "Walter", "Walters", "Walton", "Ward", "Ware", "Warner", "Warren", "Washington", "Waters", "Watkins", "Watson", "Watts", "Weaver", "Webb", "Weber", "Webster", "Weeks", "Weiss", "Welch", "Wells", "West", "Wheeler", "Whitaker", "White", "Whitehead", "Whitfield", "Whitley", "Whitney", "Wiggins", "Wilcox", "Wilder", "Wiley", "Wilkerson", "Wilkins", "Wilkinson", "William", "Williams", "Williamson", "Willis", "Wilson", "Winters", "Wise", "Witt", "Wolf", "Wolfe", "Wong", "Wood", "Woodard", "Woods", "Woodward", "Wooten", "Workman", "Wright", "Wyatt", "Wynn", "Yang", "Yates", "York", "Young", "Zamora", "Zimmerman" }; a piece of code to help : #include #include using namespace std; // Constants const int EXIT_CODE___SUCCESS = 0; const int EXIT_CODE___INVALID_CMD_LINE = 1; int main ( int argc, // Number of command line arguments char * argv[] ) // Array of cmd line arguments { ofstream outfile; /* If too few arguments, show the usage message and exit with an error */ if (argc < 2) { display_usage_message ( ); exit (EXIT_CODE___INVALID_CMD_LINE); } open_output_file ( argv [1], outfile ); /* If we are here, the output file has been opened and we're ready to go */ return EXIT_CODE___SUCCESS; } void display_usage_message ( ) { cout