Exam 2 Sample Questions from Spring 2012 Part II, Question: #2 // instantiate and activate three sensors Sensor s1 = new Sensor(); s1.activate(); Sensor s2 = new Sensor(); s2.activate(); Sensor s3 = new Sensor(); s3.activate(); // instantiate one remote using 1234 final int CODE = 1234; Remote remote = new Remote(CODE); // instantiate a bell Bell bell = new Bell(); // continually monitor final int ALARM = 100; final int NO_ALARM = 0; while ( remote.disarm() != CODE ) { if ( s1.sense() || s2.sense() || s3.sense() || remote.panic() == CODE ) { bell.activate( ALARM ); } } bell.activate( NO_ALARM ); s1.deactivate(); s2.deactivate(); s3.deactivate();