1-IntroToOO10Questions - is doing the same thing as in the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Ten Questions for Introduction to Object-Oriented Programming Code Example Project: TicTacToe Files: NormalControlFlow.java NormalControlFlowWMethods.java These two programs do exactly the same thing: play TicTacToe. 1. Run each of the two programs. Are there any differences at all in their behavior? 2. Scan through NormalControlFlow.java. How easy is it to understand the control flow? 3. There is a "do {" at the beginning of the main method. Where is the end of this statement? 4. Now scan through NormalControlFlowWMethods.java. How easy is it to understand the control flow now? 5. The main method is much shorter. Verify that that method
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: is doing the same thing as in the other implementation. 6. The second implementation, with methods, has additional lines of code to define the methods. Yet it is a half a page *shorter*. How did that happen? 7. Could the main method be made even shorter? How should the ideal length of the main method be determined? 8. Why were some variables moved into the main method? Why were others left as static variables? Could other variables be moved out of main? 9. Why are some methods private and one method public? 10. board is passed to many of the methods. Should it be a global variable? static or not? public or private?...
View Full Document

This note was uploaded on 02/28/2012 for the course CSC 337 taught by Professor Johnson during the Fall '11 term at University of Arizona- Tucson.

Ask a homework question - tutors are online