There are tasks to be done across a few files in src/main/java
, all marked with TODO
s. We recommend doing them in the order:
Trader.java
DrivableTrader.java
DrivableMap.java
The other files are provided for reference and testing purposes. These files are:
Domesticatable.java
,Drivable.java
, andTradable.java
: These are the same interfaces as the ones in Lab 3.DomesticatableTrader.java
: An example of a subclass of the Trader class. This should work once you completeTrader.java
. Use this as a reference forDrivableTrader.java
.Horse.java
andUnicorn.java
: Sample classes that implement the given interfaces.
You do NOT need to change these files, and you should not. Changing them may affect your code.
For this exercise, you will want to read through Chapter 4: Assorted Topics in Java.
You will also likely find online resources helpful, such as the following Java documentation pages:
Make sure you set the folder java
under src/main
as Sources Root in order to get hints from IntelliJ. Similarly, you can set the folder java
under src/test
as Test Sources Root in order to run the tests we've provided.
Alternatively, you might find it convenient to open just this directory as a project in IntelliJ while working on your code.
After you add, commit, and push your changes to GitHub, the test cases given to you will automatically run. This may take a few minutes.
To access the results, go to the "Actions" tab from your GitHub repository. You should see a list of workflows: click on the top-most (most recent) run. In this, you should see the points at the bottom (e.g. the number of test cases you passed) along with an Autograding job above it: if you click on Autograding, you can see the results. Expand the Run education/autograding@v1
part to see a full log of the results.