CS161 Assignment 1: Review of CS160 Material
Methods and Arrays



The objective of this assignment is to refresh your knowledge of how to solve simple programming problems involving loops, arrays and methods.
Your task is manage a collection of rectangles that conceptually represent windows on a computer screen. A rectangle is represented by the coordinates of its upper left-hand corner and its bottom right-hand corner as shown:
 
You will be provided an input file that contains the coordinates of the rectangles. Each line in the file represents a rectangle in the form,

(a, b, c, d)

where a, b are the x and y coordinates of the upper left-hand corner of the rectangle and c, d are the x and y coordinates of the lower right-hand corner of the rectangle. The rectangle shown above is represented by the tuple (50,50,100,100). The methods you need to write are the following:
Use the following file as a starting point. All your code should be written within the class Assignment1. To help you debug your code, we have provided you with code that displays a collection of rectangles. The Java code contains an example on how to use it (see the example method in the code). And here's also an example coordinates file. In addition to testing your code using this file, you are encouraged to try your own examples.

Submitting Your Assignment


Submit your Assignment1.java using the checkin program. In recitation you will practice trial submission. Note that your code should compile on department Linux machines. Make sure your code compiles, and that you are submitting the source code rather than the Java class file.