Assignment2

CSIS 10B
Assignment 2 Arrays, Assert, JavaDoc, WordList
Due: next Wed
In Class Demo (0 points):
1)
2)
3)
4)
5)
6)
7)
8)
Create arrays of int, double, String, Student
Read from a file into an array
Pick a random value from an array
Remove a value from an array
Get Hangman2 to work using an array of String
Use of JavaDoc commenting style applied to Student class
Use of assert to verify Pre/Post Conditions
Begin WordList class
Assignment (10 points) Do either Basic or Advanced.
Basic—
1) Open Lab2 folder and complete the WordList class and test using exercises in the
WordTester class.
2) Completely document WordList using JavaDoc format. Follow instructions for Section 2.5
Laboratory on page 39 of our text (you may examine the Ratio class JavaDoc in the mod1
download from last week).
3) Make sure all preconditions are checked with assert statements (where possible)
4) Add a method loadFile(String filename) to WordList that loads an entire file into
the WordList (instructions in WordTester.java)
5) Make the Hangman3 application that uses a WordList to manage selection of words, which
has been loaded from hangWords.txt. (Starting code provided in Lab2 folder).
6) (Optional) Up for a Challenge? Make a removeDuplicate( ) method that removes any
duplicate words in the list. Details in WordTester.java.
Advanced—
Create a BigInteger class that represents integers with up to 300 digits. The numbers should be
broken into chunks and stored in an array of integers. For example, the number
846,184,456,234 would be stored in an array num such that num[0] = 234, num[1]=456,
num[2]=184, and num[3] = 846. Include methods for adding, subtracting, and multiplying the
BigInteger numbers using Carry and Borrow values as needed to correctly compute the aritmetic
operations.