EECS2030E Test 2E

Mon Oct 3, 2016, 14:00-15:20
LAB 01
Version E


Instructions

There is one programming question and three other questions.

Instructions for submitting your solutions are given in the question sections. You may submit as many times as you want; your most recent submission will be the one recorded.

You may leave the lab when you are finished with the test.


Programming question

Implement this API. You do not have to include javadoc comments.

Here is a main method that you can use to perform some simple testing of your code.

Submit your program using the following command in a terminal (make sure you are in the directory containing your file Test2E.java):

submit 2030 test2E Test2E.java


Other questions

Create a file named answers.txt for your answers to the following questions.

Question 1

In a non-static method, what does the keyword this refer to?



Question 2

Which of the statements below best completes the following sentence: When overriding equals, ...

A. an object should not be equal to itself
B. an object is never equal to null
C. you must also override toString
D. you should try to be consistent with compareTo


Question 3

Inspect the API for the method Test2E.toInt. The API shows some test cases.

State two additional test cases that you would use to test the implementation of Test2E.toInt and explain why you would include these test cases.



Submit your program using the following command in a terminal (make sure you are in the directory containing your file answers.txt):

submit 2030 test2E answers.txt