Codecheck.io

This illustrates many of the convention over configuration testing approaches of the new directory-less Codecheck.io. (Note: at least one .java file must have a public static void main(String[] args) method.)

To complete the assignment, complete the following methods and click CodeCheck at the bottom of the page:

  1. Complete the code for the public static int square(int n) method in the CodecheckSquare class that calculates the square of n.
  2. Complete the code for the public static int cube(int n) method in the CodecheckCube class that calculates the cube of n.

Include an initial comment with an @author YOUR NAME <your@email.address> line in all solution files.


Note: In APCS free-response-question CodeChecks there may be code on lines with a /**/ comment in the leftmost column — like this:

   // There may be instance variables, constructors, and methods that are not shown.
/**/private String word;
/**/public HiddenWord(String word) { this.word = word; }
/**/public int length() { return this.word.length(); }

Any code on lines with a /**/ comment in the leftmost column has been added by the CodeCheck author(s) and is outside the scope of the APCS free-response question. That code is necessary to complete or test the program(s) and should not be modified, but there may be other valid implementations. Consequently, your solution cannot make assumptions about, nor make use of the knowledge of, any particular implementation of the added code.