class Zombie { private: String name double distance int speed boolean dead public: //accessors methods String getName() double getDistance() int getSpeed() boolean isDead() Zombie(String, int, int, int) void move() -- Reduces this zombie's distance by its speed, to a min of 0 distance. void die() -- Kills this zombie. } class UsernameA17 { public static void main(String[] args) processes the command line arguments (if correct) to get: int killzone String inputFilename String outputFilename (if 3 args given) otherwise, will print appropriate error message and return. Then: zombieList = loadFile(inputFilename) output = runSimulation(zombieList, killzone) print output if there is an outputFilename: appendToFile(outputFilename, output) public static ArrayList loadFile(String inputFile) throws FileNotFoundException, InputMismatchException, NoSuchElementException Opens the given inputFile, reads it in, and creates one zombie per line of the file. Returns the resulting list of zombies. Throws different exceptions if the file cannot be found, if the file contains data in the wrong format, or if the file is missing data on a line. public static appendToFile(String outputfile, String contents) Opens the given outputFile and appends the given contents to the end of the file. public static String runSimulation(ArrayList list, int killzone) Given a list of zombies and a killzone radius, returns output (as a String) of the simulation result. More specifically: count starts at 0 each round: increment count (so to 1 first time through) nearest = getNearestZombie(list) if nearest in killzone range: //human takes a shot if possible nearest.die() (append to output any details of a zombie kill) for each zombie in list: //all zombies move in towards human zombie.move() if hasZombieReachedHuman(list) != null: return finished output: FAIL if !isDanger(list): return finished output: SURVIVED public static Zombie getNearestZombie(ArrayList list) Returns the zombie (that's not dead) with the smallest distance public static Zombie hasZombieReachedHuman(ArrayList list) If one (or more) of the zombies in the list has a distance of 0, returns the first one found. If no zombies has reached the human yet, returns null instead. public static boolean isDanger(ArrayList list) Returns whether there is still an undead zombie in the list with a positive speed. }