wiki:ProgrammingPrompts

Version 9 (modified by Timothy Lin, 9 years ago) (diff)

--

Programming Prompts

Feel to add good prompts into this list as you find them. This will greatly help future software team leads and new programmers.

The prompts are written with Java in mind, but can be adapted to most languages. The downloadable test scripts are run with Java, require the main class name to be the name of the prompt, and use the default package.

Note: To use the starter code and test scripts at the bottom of the page, download them to the directory of your choice, then in Eclipse, right-click in the Project Explorer, click Import..., and in the dialog box, select General --> Existing Projects into Workspace. Select the directory you saved the unzipped file into for the root directory, and select all projects there.

Checkerboard
Write a static method that takes two int parameters m and n and returns a checkerboard-patterned two-dimensional boolean array that is m-by-n in size. Any given checkerboard square on a checkerboard has no adjacent squares with the same color (boolean value).
https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Checkerboard_pattern.svg/300px-Checkerboard_pattern.svg.png

Test Scripts

Attachments (5)

Download all attachments as: .zip