Programming Assignment 9


Due: Week of Mar. 27 before lab


  1. (25 points) Sudoku. Write a function to verify a solution to a Sudoku puzzle. It must contain the following header:
    public static boolean verifySudoku(int[][] solution);
    Write a client program that takes a filename as a command-line argument, whose contents represent a solution to a sudoku puzzle, and output whether the solution is correct. You can assume the files contents always contain 81 numbers whose values are between 1 and 9.
  2. (50 points) Write a description of an object-oriented framework. You can choose anything you would like, except for the aquarium and the world of Harry Potter as was discussed in class. You need at least four objects interacting with each other. Provide both a written description (typed, one paragraph per object with one paragraph overview) and a UML diagram (computer generated, not hand drawn!). Be sure to include correct notations for aggregation and composition in the diagram.
  3. (25 points) This course has a final programming project. It should revolve around an interactive program or simple game (be visual), involve both file input and output, and be composed of at least 3 objects. A good example would be a version of Guitar Hero for the keyboard. In this you would read a song from a file (series of buttons needing to be pressed not an actual song), then have the person press each of the buttons to win the game, and finally write a set of statistics to a file.
  4. Bonus. (20 points) Maze solver. Write a program that takes a single filename as a command-line argument, whose contents represent a maze, and determine whether or not a path exists. If a path exists, output one possible solution to the maze. The first line of the file defines the size of an N x M matrix. The rest of the contents are characters: 's' is the start, 'g' is the goal, 'x' is an obstacle, and '.' is an empty cell. Solve this problem with a recursive function. When outputting the solution, show the entire maze with all of the '.'s replaced with 'p' if they lie along your solution path. You may assume the contents of the file are always correct.