Javadocs Practice Assignments

Overview

Javadocs are a brilliant way to integrate documentation with the source code. The are multi-line comments that start with an extra * (i.e., /**). The javadoc tool reads a source code file and parses the Javadocs, looking for a description and tags. These assignments will help you in writing both class and method-level Javadocs.

Submission Instructions

Submit each of the following practice assignments at codePost.io. To register for a free codePost account, please follow these instructions.
Watch this short video for a demonstration of submitting an assignment and reviewing the results:
YouTube video: codePost: Submission and Checking Results Thumbnail
Note, currently, feedback is not visible in Safari.

Practice Assignments

Class-level Javadoc

Write the class header for a Robot class (you can leave the entire body of the class blank :). The class is for a Spike Prime LEGO robot. Add a (class-level) Javadoc before the class header. Include at least the following items (in the following order):

Method Javadoc (@param)

Reuse your Book class from your previous practice assignments (with at least the setTitle method). Write a (method-level) Javadoc before the setTitle method. Include the following items (in the following order):

Method Javadoc (@return)

Reuse your Book class from your previous practice assignments (with at least the getTitle method). Write a (method-level) Javadoc before the getTitle method. Include the following items (in the following order):

Full Method Javadoc

Add the following method to your Book class:

    public String cpsc1302LibraryEntry( double deweyDecimal, String authorAbbreviation ){
        return deweyDecimal + ", " + authorAbbreviation + ", " + title + ", " + author + ", " + pages;
    }
Add a complete Javadoc for the cpsc1302LibraryEntry method, which produces a CPSC1302 library entry for the book. The first parameter is the Dewey Decimal classification for the book. The second parameter is the five letter code for the author of the book.