This lab is to be done individually. Create a directory lab5, and put your answers there. Submit answers to all of these questions before class on Friday, 10 February 2006.
Tasks for the day:
int x = 117; while (x >= 0 && (x % 3) != 2) { while (x % 2 == 1) { x = (x - 1)/2; } if (x == 6) { x = 50; } x = x - 1; System.out.println("x = " + x); }What will it output? Trace through this code. In a file loop.txt, describe what output will be produced. (You may also do this on paper if you prefer.) You may retype this code into a Java program and run it, but only after you have traced it by hand. If your prediction was not correct, explain what was wrong. Also in loop.txt, explain what the output would be if we set x=127 instead.
The current borrower of Taxi: The Harry Chapin Story is David Liben-Nowell The current borrower of The Chicago Manual of Style is NoneWhen you're done, modify LibraryBookTester class to create an array of 40 library books. Name them "Encyclopedia Brittanica Volume 1", "Encyclopedia Brittanica Volume 2", etc. Borrow them all yourself. Print out their titles and current borrowers.
By David Liben-Nowell.