Lab 20: Interfaces


Due Monday, November 20 at 11:59 PM

Goals for This Lab

By the time you have completed this work, you should be able to:

Provided files:

Step-by-Step Instructions

Step 1: Download All Required Files

Download all the provided .java files under the Provided files listing above. For convenience, these same files are also provided in this zipfile.

Step 2: Edit CanCrawl.java

You will need to define a custom interface. The comments in CanCrawl.java provide more details.

Step 3: Edit Baby.java

You will need to define a custom class. The comments in Baby.java provide more details.

Step 4: Edit Bug.java

You will need to define a custom abstract class. The comments in Bug.java provide more details.

Step 5: Edit Spider.java

You will need to edit this file to work with the new class setup. The comments in Spider.java provide more details.

Step 6: Edit Bee.java

You will need to define a custom class. The comments in Bee.java provide more details.

Step 7: Run the Code in Main.java

Run the program in Main.java, which tests out all the rest of the code you've written. It's likely that if you made a mistake, this code won't compile. Once your code is compiling and running, it should produce the following output:

Bobby the baby takes a breath
Bobby the baby coos
Bobby the baby slowly crawls along
Bea the bee crawls with purpose
Sally the spider crawls with spindly legs
Bea the bee buzzes through the air

Step 8: Turn in Your Solution Using Canvas

Log into Canvas, and go to the COMP 110L class. Click “Assignments” on the left pane, then click “Lab 20”. From here, you can upload your code. Specifically, you must turn in the following five files:

In addition, if you collaborated with anyone else, be sure to download collaborators.txt and write the names of the people you collaborated with in the file, one per line. Please submit this file along with the other five files.

You can turn in the assignment multiple times, but only the last version you submitted will be graded.