Practice Exam 2 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.) page 357

2.) pages 292-293

3.) true. does anyone know where the book asys this?

4.)

5.) page 248

6.) the local variables of instance methods, not the instance data memebers

7.)

8.) page 254

9.) see precedence table page 239

10.) you don't have to worry about recursion, but it's on page 338

11.) see precedence table page 239

12.) ???

13.) page 299

14.) page 236

15.) work it out with pencil / paper

16.)

17.) keyword "first"

18.) pages 372-373

19.) page 273

20.) draw out the diagram if necessary, and trace the path for a small example

21.) 'flag-controlled' is when a single boolean variable is used as the control variable

22.) draw out the diagram if necessary, and trace the path for a small example

23.)

24.) see precedence table page 239

25.)

26.)

27.) pay no attention to overflow

28.)

29.) i don't like this question, but if you were going to draw a for loop, what would it look like?

30.) the least common multiple can be found by looking at successive multiples of one or the other

31.) you don't have to worry about counters

32.) if you have trouble, pick some test points and see what each possible answer says about them

33.) if you're really stuck, stick it inside a main method and run it

34.)

35.)

36.)

37.)

38.)

39.)

40.)
Written Answers


41.) could be done in three lines, but better to make local vriables and make your final formula more readable.

42.) don't make this any harder than it needs to be. We're simply asking for you to make a method call, and assign that value to a local variable that you must first declare.

43.) make your menu, choose an appropriate loop (while, do-while, for), choose a method of selection (switch case or if then elses), and keep getting menu selections, after calling the appropriate method.

44.) don't work in pen

45.)

46.) just make a String with the given words

47.) use substring and concatenation to rearrange parts of the first String. Remember what the parameters in substring mean.