EECS2030E Test 1

Tue Sep 28, 2016, 16:00-16:30
LAB 2
Version D


Instructions

There is one programming question and one multiple choice question.

Instructions for submitting your work 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. Please return to the lab when the test is over for your regularly scheduled lab.


Resources

Java API


Programming question

Implement this API. You do not have to include javadoc comments. If you do not know the value of the constant, just choose the value yourself.

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

submit 2030 test1D Test1D.java


Multiple choice question

Create a text file named answers.txt (use File->New-> Untitled text file in eclipse). Type your answer (A, B, C, or D) to the following question in the text file.

Question 1

Consider the following utility class:

public class MyUtils {
  public static final String DEPT = "Electrical Engineering and Computer Science";
}

What is missing from MyUtils that should be there?

A. at least one non-static field
B. at least one non-static method
C. a toString method
D. a private default constructor

Did you remember to include such a feature in your Test1D class?

Save your file (it might be easiest to save the file in the same directory as your Test1D.java file). Submit your answer using the following command (make sure you are in the directory containing your file answers.txt):

submit 2030 test1D answers.txt