You are not allowed to use the internet in general for this exam, only what is linked from this page and the Java API. You may use the computer to compile and test your Java code. You are bound by the Honor Code for this exam, which you need to sign. Show your work on all problems for full credit.
Create a directory on the cs.centenary.edu
server called exam1
, and
copy your solutions there.
Queue<Integer> q = new ArrayQueue<Integer>();
q.add(5);
q.add(9);
q.remove();
q.remove();
q.add(4);
q.add(17);
q.add(58);
q.add(19);
q.add(47);
q.remove();
q.remove();
q.remove();
q.add(5);
public void flipLight()
which will change the light from off to on, or vice versa.
public void pullChain()
which will decrease the speed of the fan by one, or turn it on high if the speed is at 0.
public boolean isLit()
which will return true if the light is on, otherwise false.
public int getSpeed()
which will return the current speed of the fan.
Use the following Android Focus project instead of the skeleton code linked on the Focus website.
public boolean removeLast(E target)
for our LinkedList that will remove the last found
instance of the element target
. If the element is not found in the LinkedList, return false.