Practice Exam 1 Help



Unfortunately, I cannot provide a copy of the practice exam with the answers on it. However, I've provided hints for most of the questions that should lead you to the answers.


True/False Multiple Choice


1.) the keyword here is "logical"

2.) page 164

3.) this is a rare chapter 0 question

4.) since all operators are subtraction, there is a tie in their precedence. How are ties settled?

5.)

6.) page 84

7.) naming conventions

8.) page 45

9.)

10.) 16 memeber types

11.) number ranges

12.)

13.)

14.) style guide

15.) this won't throw you off unless you can program in C

16.) the keyword here is "syntax"

17.) supplement under METHODS, scope

18.) don't worry about this one

19.) visibility modifiers

20.) if you don't know this, you can deduce it from naming conventions

21.)

22.)

23.) do the math: (1080/n - 180)

24.) page 98

25.) well, the purpose of javadocs is to provide information about what members a class has that can be used by other classes

26. - 29.) pay careful attention to A) from where the method is being called, B) the argument types and order and the parameter types and order, C) the assignment types after the method call and the return types of those methods

30.) starting on page 29

31.) 16 memeber types

32.) starting on page 49

33.) numeric expressions and assignments

34.) Math .random() returns a random decimal number between 0.000000 and .9999999

35.) the back cover of your book

36.) supplement under METHODS, declaration

37.) refer to class notes on the primitives tree

38.) 16 memeber types

39.) well, this questions has answers that vary in assignment type, and proper method calling from the Game class

40.) don't worry about this one

41.) numeric expressions and assignments

42.) naming conventions, although they all break some convention or other.


Written Answers


1.) okay, one step at a time, using correct syntax for data declaration and usage (assignment). first, verify the modifiers. Then, decide upon a good primitive type. Next, pick a name that fits well with the described behavior.

2.) okay, one step at a time, using correct syntax for method declaration and defintion. first, verify the modifiers. Then, decide upon a good return type. You already know what the name will be. Next, pick a parameter list, based upon what you need to perform the function, paying attention to scopes (where the method is in relation to other members). Finally, define your method to do as the question asks, and finish with a return statement unless you method has a void return type.

3.) here, you just need to fill in the definition part of the main method. Refer to your textbook back cover for methods in the javabook2 package. You will also have this for the exam Tuesday.

4.) ONE STEP AT A TIME!!! The names of the class, constructor, and public methods are given to you. The other members, if you need them, are not. Decide what makes sense for your class to have as members, paying attention to all the details in #1 above. The constructor should initialize all data members. Then, go through all the methods one by one as with question #2 above, though the paramter lists have been given to you. Good luck, and remember to take it all ONE STEP AT A TIME!!!