Your instructor will assign one or more of the following problems. Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files.

  1. Modify the Calgorithmic musicbox system to implement appropriate error checking for the following file read errors:

    Include test cases exercising all your new error checking code.

  2. Extend the Calgorithmic musicbox to handle chords, that is playing more than one note at a time in a single part. Your system should be able to read and play any of the following parts from Chopsticks: ChopSticksSoloVerse.txt, ChopSticksSoloBridge.txt, or ChopSticksAccompaniment.txt.

    Note that when you upgrade your Chord class to represent a list of pitches, you’ll need to use List<Integer> (rather than a list of int s). Lists require reference types.

    Extra Credit: Implement the complete chopsticks song by playing the verse with the accompaniment and then the bridge with the accompaniment. You will need to work through all the lab exercises before you can do this.

  3. Create an animation controller such as the one shown here.

    a simple animation GUI controller

    This application loads a sequence of images (here, the images are from Eadweard Muybridge’s iconic early work on animation) and presents those images one-at-a-time in sequence. To help you focus on working with lists and files, we are providing several resources with which to begin ( download this zip file: ). Once you have unzipped, you should have:

    Be sure to begin by reading the code provided until you understand how it works.

    You are welcome to implement this program as you see fit, but here are some algorithmic steps that may help:

    1. Change the declaration of myImage in the panel to instead be a list of images
    2. Update the constructor for the panel:
      1. Receive a file that contains a list of names of files that contain images to be displayed (see the contents of horseImageFilenames.txt).
      2. Instead of loading of a single image, update the constructor to load each image in the file received
    3. Create a new instance variable to keep track of the current image number to be displayed
    4. Update the draw method
      1. Display the image corresponding to the current image number from the list of images
      2. Update the current image number only if the animation is running

    At a minimum, your program must run the animation in a continuous loop and allow the user to pause and play the animation using the buttons. For extra credit, you may also add additional animation controls and a message panel as shown in the picture above.

Checking In

Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files. We will grade this exercise according to the following criteria:

If you work in teams for this homework assignment, be sure to submit all team members’ names in the code documentation.