RU beehive logo ITEC dept promo banner
ITEC 120
2007fall
ibarland,
jdymacek

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs

exam2-study-questions
exam2 study sheet
2007.Fall

Exam1 is scheduled for class on Oct.25 (Thu). The exam will be in-class, on-paper, closed-computer. It will consist of questions very much like these questions, the homeworks, and labs. Some of the questions may be directly from these sources. The single best way to study for the exam is to sit down and re-work homework and lab questions from scratch.

The material from Exam1 won't be especially tested, but due to the cumulative nature of the material, you should know all the topics from the exam1 study questions.

New Topics

When giving a java expression or definition, you should be able to type it into BlueJ's Code Panel without any error; this means knowing where you need parentheses, where you need squirly-braces, and where you need semicolons (though I'll give some slack on these). I particularly recommend the problems which require actual code or definitions.

  1. Review the lecture notes, and write for yourself any of the sample programs/exercises therein.
  2. Review the labs, and write (from scratch) any of those programs again.
  3. Review the homeworks, and write (from scratch) any of those programs again.
  4. While not intentionally cumulative, all the concepts from the exam1-study-questions—exam1 study sheet: 2007.Fall are still pertinent.
  5. What is the mantra for calling a regular (non-static) method? What about for a static method?
  6. What is the mantra for a function's signature? What adjectives might come in front of the signature?
  7. A Circus has a name, a ticket-price, an EmCee, two Dogs, and a PizzaServer (each as used in various lectures and labs).
  8. The following statement doesn't make sense. Why not? String m = System.out.println( "hi" );
  9. What is the value of (new String("cat") + new String("hay")) == new String("cathay")? Confirm by typing this expression into Code Pad. Explain why that is the answer (1 short sentence).
  10. What is the value of (new String("cat") + newString("hay")).equals( new String("cathay") )? Confirm by typing this expression into Code Pad. Explain why that is the answer (1 short sentence).
    What if we use "cat", "hay", and the proper noun "Cathay"?
  11. What is the value of new String("cat") + (newString("hay").equals( new String("cathay") ))? Confirm by typing this expression into Code Pad. Explain why that is the answer (1 short sentence).
  12. true or false?: It is possible to write a method swapDoubles such that the last line below is true:
    double x = 5.0;
    double y = 7.0;
    swapDoubles( x, y );
    (x  == 7.0);
    
  13. Draw a picture of the object (and object references) involved during a sequence of calls to Dog's swapSoundsWith.
  14. Draw a picture of the object (and object references) involved during a sequence of calls to Cat's badClone method, and a working clone method, from lect09c.
  15. Draw pictures of what all the existing (references to) objects look like, after each of the following five lines, based on your hw08-soln
    Explorer me = new Explorer( "Dora" );
    Treasure t1 = new Treasure( "a singing map", "It guides you: over, around, and up.", 0.05, "");
    me.grab( t1 );
    me.grab( new Treasure( "a collideascope", "Like a kaleidoscope, but more dangerous.", 1, "" ) );
    me.dropLeft();
    
    (Assume that if both pockets are free, new Treasures are put into the left-pocket, if both pockets are free.)
  16. Review all lab exercises, and problems mentioned on lecture pages (whether or not a solution is provided). Any of those problems are fair game for the exam.
  17. Book exercises 5.1-5.9, 5.13,5.15,5.17, 5.19.
    The self-review questions tend to be good, although we've not talked about loops or overloading.
    Note that the book makes heavier use of java.util.Random than we have. (It's difficult to write test cases for!) You can see the standard bototm-of-page link for “java.util docs”.
  18. Book exercises 4.1 - 4.6.
    You can also look at the self-review questions (up through 4.7a). We've not talked about loops.
  19. Book exercises 3.1 - 3.9 (excluding 3.5).
    Self-review exercises are good SR3.4-3.6 and SR3.16,
    Note that we haven't talked about printf, and to answer some of the questions means looking at the documentation for String and/or Random (follow the top-of-page links for documentation of java.lang and java.util, respectively).

1That is -- it's cool to see an old dog, but not if it costs a whole lot more.      

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs


©2007, Ian Barland, Radford University
Last modified 2007.Oct.23 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme