EECS2030A Test 1A

Thu Sep 22, 16:00-16;30
LAB 1
Version A


Instructions

There is one programming question and one multiple choice question.

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

Use the button at the bottom of the page to submit your answer for the multiple choice question. 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.


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 a value yourself.

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

submit 1030 test1A Suitcase.java


Multiple choice question

Question 1 Consider the following code snippet.
int a = 0;
int b = 1;
Utility.swapper(a, b);
System.out.printf("%d %d", a, b);

Which of the following statements is correct?

A. The above snippet prints the string "1 0".
B. The above snippet prints the string "0 1".
C. What the snippet prints depends on the body of the swapper method.
D. None of the above.