diff options
| -rw-r--r-- | src/Q10/TrainTimeTable.java | 11 | ||||
| -rw-r--r-- | src/Q4/RandomSumGame.java | 2 | ||||
| -rw-r--r-- | src/Q5/Citizen.java | 1 | ||||
| -rw-r--r-- | src/Q5/ComputeIntellect.java | 5 | ||||
| -rw-r--r-- | src/Q5/Village.java | 15 | ||||
| -rw-r--r-- | src/Q6/WeekDay.java | 6 | ||||
| -rw-r--r-- | src/Q7/Person.java | 5 | ||||
| -rw-r--r-- | src/Q9/MovingRobot.java | 8 | ||||
| -rw-r--r-- | src/Q9/Robot.java | 6 |
9 files changed, 47 insertions, 12 deletions
diff --git a/src/Q10/TrainTimeTable.java b/src/Q10/TrainTimeTable.java index 8c16ac8..201f7d2 100644 --- a/src/Q10/TrainTimeTable.java +++ b/src/Q10/TrainTimeTable.java @@ -19,7 +19,10 @@ public class TrainTimeTable { this(new LinkedList<Station>()); } - /** An overloaded constructor to allow injections of each of the stations in the schedule. */ + /** + * An overloaded constructor to allow injections of each of the stations in the schedule. + * @param schedule the list of stations + * */ public TrainTimeTable(LinkedList<Station> schedule) { this.schedule = schedule; } @@ -49,6 +52,7 @@ public class TrainTimeTable { /** * An overload of displaySchedule that accepts a PrintStream to write output to different * printers. + * @param out the output stream to write to */ public void displaySchedule(PrintStream out) { out.println(String.format("%15s | %7s | %9s | %3s", "Station", "Arrival", "Departure", "Day")); @@ -72,7 +76,10 @@ public class TrainTimeTable { return null; } - /** This is the main entry point to the console application. */ + /** + * This is the main entry point to the console application. + * @param args the argument vector to passed to the program. + * */ public static void main(String[] args) { System.out.println("=== Question 10 ==="); LinkedList<Station> stations = diff --git a/src/Q4/RandomSumGame.java b/src/Q4/RandomSumGame.java index 43728a7..b174d9e 100644 --- a/src/Q4/RandomSumGame.java +++ b/src/Q4/RandomSumGame.java @@ -131,7 +131,7 @@ public class RandomSumGame { /** * The entry point to the console application. * - * @params args the command line arguments passed to the program + * @param args the command line arguments passed to the program */ public static void main(String[] args) { Scanner in = new Scanner(System.in); diff --git a/src/Q5/Citizen.java b/src/Q5/Citizen.java index 92b836f..c5da9b8 100644 --- a/src/Q5/Citizen.java +++ b/src/Q5/Citizen.java @@ -70,6 +70,7 @@ public class Citizen { /** * Converts an integer to a string. * + * @param i the integer to convert to a string * @return the converted integer as a string. */ public static String convert(int i) { diff --git a/src/Q5/ComputeIntellect.java b/src/Q5/ComputeIntellect.java index 68db941..54ca2fb 100644 --- a/src/Q5/ComputeIntellect.java +++ b/src/Q5/ComputeIntellect.java @@ -53,7 +53,10 @@ public class ComputeIntellect { return this.undergraduate; } - /** Tallys the # of citizens with different educational qualifications. */ + /** + * Tallys the # of citizens with different educational qualifications. + * @param citizens the array of citizens to tally. + * */ public void distributionOfQualification(Citizen[] citizens) { for (Citizen citizen : citizens) switch (citizen.getEducationalQualification()) { diff --git a/src/Q5/Village.java b/src/Q5/Village.java index 47c6891..fba9c8a 100644 --- a/src/Q5/Village.java +++ b/src/Q5/Village.java @@ -20,7 +20,10 @@ public class Village { this(new ArrayList<Citizen>()); } - /** Creates an instance of a village with specific villagers. */ + /** + * Creates an instance of a village with specific villagers. + * @param citizens the list of citizens in the village + */ public Village(List<Citizen> citizens) { this.citizens = citizens; } @@ -30,7 +33,10 @@ public class Village { return this.citizens.size(); } - /** Adds a citizen to the village with a specific qualification. */ + /** + * Adds a citizen to the village with a specific qualification. + * @param qualification the qualification for the citizen + * */ public void addCitizen(int qualification) { this.citizens.add(new Citizen(Citizen.generateId(), qualification)); } @@ -45,7 +51,10 @@ public class Village { return this.citizens.toArray(new Citizen[this.citizens.size()]); } - /** The entry point to the console application. */ + /** + * The entry point to the console application. + * @param args the argument vector given to the program. + * */ public static void main(String[] args) { Scanner in = new Scanner(System.in); Village village = new Village(); diff --git a/src/Q6/WeekDay.java b/src/Q6/WeekDay.java index db77c17..7ef1082 100644 --- a/src/Q6/WeekDay.java +++ b/src/Q6/WeekDay.java @@ -21,6 +21,7 @@ public class WeekDay { * @param day the day of the month * @param month the month of the year * @param year the year + * @return the name of the day of the week. (Sunday to Saturday) */ public String getWeekDay(int day, int month, int year) { this.ensureValidDate(year, month, day); @@ -53,7 +54,10 @@ public class WeekDay { throw new IllegalArgumentException(); } - /** The entry point to the console application. */ + /** + * The entry point to the console application. + * @param args the argument vector given to the program. + * */ public static void main(String[] args) { Scanner in = new Scanner(System.in); diff --git a/src/Q7/Person.java b/src/Q7/Person.java index 062a7a3..8992197 100644 --- a/src/Q7/Person.java +++ b/src/Q7/Person.java @@ -130,7 +130,10 @@ public class Person { this.setBMI((this.weight * 703) / Math.pow(height, 2)); } - /** The entry point to the console application. */ + /** + * The entry point to the console application. + * @param args the argument vector passed to the program. + **/ public static void main(String[] args) { ArrayList<Person> people = new ArrayList<Person>(); people.add(new Person("Andrew", 125.5, 55.1)); diff --git a/src/Q9/MovingRobot.java b/src/Q9/MovingRobot.java index 8c20ec8..ba587ab 100644 --- a/src/Q9/MovingRobot.java +++ b/src/Q9/MovingRobot.java @@ -28,7 +28,7 @@ public class MovingRobot extends Robot { /** * Checks to see if a robot can advance in the direction provided. * - * @param the direction that a robot wants to advance to. + * @param direction the direction that a robot wants to advance to. * @return returns true if the robot can advance to the given direction. */ public boolean validateNextMove(int direction) { @@ -59,7 +59,11 @@ public class MovingRobot extends Robot { return this.rng.nextInt(7) + 1; } - /** @return true if the two robots are in the same coordinate. */ + /** + * @param r1 robot 1 + * @param r2 robot 2 + * @return true if the two robots are in the same coordinate. + */ public static boolean sameSlot(Robot r1, Robot r2) { return r1.getX() == r2.getX() && r1.getY() == r2.getY(); } diff --git a/src/Q9/Robot.java b/src/Q9/Robot.java index ee495e6..6f9d2c0 100644 --- a/src/Q9/Robot.java +++ b/src/Q9/Robot.java @@ -66,7 +66,11 @@ public class Robot { this.y = y; } - /** @return true if the robot is at the given coordinate */ + /** + * @param x the x coordinate + * @param y the y coordinate + * @return true if the robot is at the given coordinate + * */ public boolean atPosition(int x, int y) { return getX() == x && getY() == y; } |
