Warmup with Java and JUnit

DUE: 11:59PM, Saturday 30 January 2016

25 points


Objectives

  • Become familiar with JUnit (or review JUnit if you already know it)

Tasks

  1. Create a package called a1.yourEID

    Note that the classes that you will implement below must be inside a package called a1.yourEID, where yourEID refers to your EID.

  2. Implementation of Roman number conversion

    Consider the following class called Roman.

        public class Roman {
            public int toDecimal(String romanNumber) throws InvalidNumberException
            public String toRoman(int decimalNumber) throws InvalidNumberException
        }
    

    Implement the classes Roman and InvalidNumberException. Assume that conversion can only occur for numbers within the range 1 (inclusive) through 4000. Throw an InvalidNumberException if the number is out of range. The same exception is also thrown if the romanNumber argument is invalid according to the rules for Roman numbers. You should use the following site for conversion rules: http://www.novaroma.org/via_romana/numbers.html

  3. Implementation of JUnit test cases

    Implement a class called RomanTest containing JUnit test cases for each of the two methods inside Roman.

  4. Create a Jar file called a1.jar containing the three Java source files. Doublecheck that you have included source files (i.e., .java files), not compiled class files (i.e., .class files).

Submission

Submit the a1.jar file using Assignment Submission in Canvas.


Grading criteria

  • Functionality of the implementation classes (implement methods correctly): 10 points
  • Functionality of test classes: 15 points

Up to 5 points may be deducted for not following the packaging structure or names used for the classes and the methods of each class.