Experience II

During my time as a college student, I have taken four programming courses. Before this, I had no prior knowledge of the subject and quickly fell in love with it. This was a Java coding project where we created a “drone” that could search different digital rooms that our professor created. It searched for missing cellphones, navigating each unique layout. I designed, implemented, and tested algorithms until I found one that could complete the task. The drone could track where it had been and visually display its search path. The visual tool of this specific project made the debugging process more engaging for me. This project was challenging for me at the time, and made me reconsider the best way of completing programming assignments. It taught me to predict outcomes and think more algorithmically instead of linearly. I learned to enjoy breaking down systems that were complex at first glance. This project was a milestone that helped me understand what it means to think like a programmer. Cybersecurity professionals must have a deep understanding of the systems they protect, and it helped me feel like I was a step closer. Aside from trying to get it to work, I started to consider where my code could fail. This project reflects my technical fluency, ability to learn from mistakes, and persistence in catching errors.


import java.lang.reflect.InvocationTargetException;

import javax.swing.SwingUtilities;

import controller.FoneDroneController;
import simulator.Drone;



/**
 * A driver for running FoneDroneController.
 * 
 * @author Ethan Lawson
 * @version 1.1
 */
public class FoneDrone {

    /**
     * The entry-point of the application.
     * 
     * @param args The command line arguments (which are ignored)
     * @throws InterruptedException If something goes wrong with the GUI
     * @throws InvocationTargetException If something goes wrong with the GUI
     */
    public static void main(String[] args) throws InterruptedException, 
        InvocationTargetException {
        
        Drone drone;
        FoneDroneController controller;

        controller = new FoneDroneController("540-568-1671");

        drone = new Drone(controller, "firstfloor.txt");
        controller.setDrone(drone);
        SwingUtilities.invokeAndWait(drone);
    }

}
package controller;

import simulator.*;
/**
 * Class for controlling the FoneDrone.
 * 
 * @author Ethan Lawson
 * @version 1.0
 */

public class FoneDroneController extends DroneController {
    private int[] location;
    
    /**
     * Constructor for FoneDrone.
     * 
     * @param number of phone.
     */
    public FoneDroneController(String number) {
        super(number);
        this.location = null;
    }
    
    public int[] getLocationOfPhone() {
        return location;
    }
    
    /**
     * Starts the search.
     */
    public void start() {
        search();
    }
    
    /**
     * Method with recursion for searching.
     * 
     * @param d direction to search.
     */
    private void move(Direction d) {
        if(!drone.hasBeen(d) && drone.canMove(d) && location == null) {
            drone.move(d);
            // check each new location.
            location = drone.checkForPhone(number);
            // create search at different location.
            search();
            // reverse movement.
            drone.move(d.opposite());
        }
    }
    
    /**
     * Code for finding phones.
     */
    private void search() {
        // Check easy case if drone does not need/can not to move.
        location = drone.checkForPhone(number);
        if(!(location == null)) {
            return;
        }else {
            // if location is null try these.
            move(Direction.FORWARD);

            move(Direction.RIGHT);

            move(Direction.BACKWARD);

            move(Direction.LEFT);
        }   
    }
}