CSSE 220 – Object-Oriented Software Development

Homework 2

Objectives

Practice with primitive types, objects, and methods in Java.

Tasks

  1. Complete the assigned reading for the next session: read Big Java §2.8–2.13 and the first two pages of this intro to UML Class Diagrams (The course schedule will list the reading to be completed before each session.) As you read, see if you can answer the self-check questions. If there is something you do not understand, make note of it so you can ask about it.
  2. Answer 3 stars worth of Big Java Chapter 2 Review questions on the Chapter 2 page of your team's Wiki on ANGEL.
  3. Programming: We started these in class. Please finish them and commit your answers to your SVN repository.
    1. Your programming work for this assignment must be done in the ObjectsAndMethods project inside Eclipse. Use the SVN Repository Exploring perspective to check out this project, then switch back to the Java perspective.

    2. In Eclipse, open the file UsingStrings.java. Complete the TODO items listed in the main() method.
    3. In Eclipse, open the file SomeTypes.java. Complete the TODO items listed in the main() method.
    4. Edit the file FourRectanglePrinter.java as follows:
      1. Construct a Rectangle object using the four random values generated for you. Store the object in a new variable named box.
      2. Print the location of the rectangle by calling System.out.println(box).
      3. Translate and print the rectangle three times, so that, if the rectangles were drawn, they would form one large rectangle:
        Expecting locations for translated rectangles

      From BigJava, Exercise P2.3

    5. Edit the file WordGames.java, completing each of the TODO items in the file. The UML class diagram for String in the session 2 slides gives all the methods that you will need.

Turn-in Instructions

We will grade your Wiki contributions using ANGEL. Turn-in your programming work by committing it to your SVN repository.