EECS2030 Practice Test 1


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.

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 constants, just choose values yourself.

During the actual test, you will see something like the following to submit your work; don't actually do this for the practice test!

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

submit 2030 test1C TestC.java


Multiple choice question

Question 1 Consider the following method header in the utility class Utility:
public static int someMethod(double x)

Suppose that a client invokes the method like so:

double clientX = 1;
int result = Utility.someMethod(clientX); 

Which of the following statements is correct?

A. someMethod cannot change the value of clientX
B. someMethod cannot change the value of x
C. if someMethod changes the value of x then the value of clientX also changes
D. someMethod can change the value of clientX without changing the value of x