CSSE 220 – Object-Oriented Software Development

Homework 1b

Objectives

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

Tasks

  1. Programming: We started these in class. Please finish them and commit your answers to your SVN repository.
    1. In Eclipse, checkout the ObjectsAndMethods project.

      • Use the SVN Repositories view to check out this project.
    2. Edit the file SomeTypes.java, completing each of the TODO items listed in the main() method.
    3. 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

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

Remember, in all your code:

Here is the grading rubric for the ObjectsAndMethods project.

Turn-in Instructions

Turn-in your programming work by committing it to your SVN repository.