## Homework #3## Problem 1 (10 points)Integer is part of the Java API.
Suppose you attempt to extend the Integer class and add a new method that returns the integer as a String that is
written in hexadecimal. Explain why you're having trouble doing it.
## Problem 2 (20 points)
Note: Your class is supposed to do everything that Random can do, so pay careful attention to what constructors should be possible. For example if Random can be instantiated with a seed parameter, then yours should be able to do the same. The other thing you have to do for this problem is to write a tester for your new class. This is not a unit-test (you have to write unit-tests anyway), instead a wrapper program that uses your class and validates that the sequence of numbers it generates appears to be random. ## Problem 3 (20 points)
For example, if the string is "This class is easy", then your new method will return an array where the 0th element is "This", the 1st element is "class", the 2nd element is "is", and the 3rd element is "easy". ## Problem 4 (40 points)In this problem you'll get to write a little bit of Ruby code. For simplicity, take the problem described in HW-1 and produce a Ruby implementation.
## CreditsProblems #1, #2, and #3 were inspired by an assignment posted here.
$Id: hw3.html,v 1.1 2011/03/23 17:20:36 virgil Exp $ |