EECS2030 Test 1

Version G


GETTING STARTED

  1. Save this eclipse project file.
  2. Start eclipse; use the workspace suggested by eclipse.
  3. Import the test project by doing the following:
    1. Under the File menu choose Import...
    2. Under General choose Existing Projects into Workspace and press Next
    3. Click the Select archive file radio button, and click the Browse... button.
    4. Navigate to your home directory (the file chooser is probably in the workspace directory).
    5. Select the file test1G.zip and click OK
    6. Click Finish.
  4. All of the files you need for this test should now appear in eclipse.

Java Standard Library Documentation

Java API


To submit your work

  1. Open a terminal. You will use this terminal to submit your work.
  2. Copy and paste the command cd eclipse-workspace/Test1G/src into the terminal and press enter.
  3. Type the following command and press enter to submit your work:

submit 2030 test1G RangeOfYears.java


Question

Implement the class described by this API. You do not have to include javadoc comments.

  1. Start by reading the API to understand what the class does.
  2. Decide how many fields you require, what the fields represent, and what their types are. Add them to your class.
  3. Implement the methods getMinimum and getMaximum first. The unit tester that is provided relies on these methods.
  4. Implement the constructors.
  5. Implement the methods.
  6. Use the unit tester to help you, but be aware that the tests cover only the simplest of cases. It is possible to receive a failing grade even if your solution passes all of the given tests.
  7. You may modify the unit tester as you see fit.

Leap years

A year is a leap year if it is evenly divisible by 400, or if the year is divisible by 4 and not divisble by 100. For example, the year 2000 was a leap year because 2000 is evenly divisble by 400. The year 2100 is not a leap year even though it is evenly divisble by 4 because it is also evenly divisible by 100.