Lab 17: private, Getters, Setters, toString, and Memory Representation


Due Wednesday, November 8 at 11:59 PM

Goals for This Lab

By the time you have completed this work, you should be able to:

Provided files:

Step-by-Step Instructions

Step 1: Edit Rectangle.java

Download the Rectangle.java file, and open it in jGrasp (or a text editor of your choice). You will need to define a constructor for this class, along with a series of methods. The comments in Rectangle.java provide further details.

Step 2: Edit RectangleMain.java

Download the RectangleMain.java file, and open it in jGrasp (or a text editor of your choice). You will have to complete the addSomethingToWidthHeight method in this file. The comments in RectangleMain.java provide further details.

Step 3: Complete the Lab 17 Handout

A handout concerning memory representation and program outputs is distributed along with this lab. Complete the questions in the handout. You may physically turn in the handout on class Thursday, or scan it / take high-quality pictures of it and submit it along with your code to Canvas.

Step 6: Turn in Your Solution Using Canvas

Log into Canvas, and go to the COMP 110L class. Click “Assignments” on the left pane, then click “Lab 17”. From here, you can upload your answers and your code. Specifically, you must turn in the following two files:

If you choose to digitally submit your handout, you must submit it in one of the following formats:

In addition, if you collaborated with anyone else, be sure to download collaborators.txt and write the names of the people you collaborated with in the file, one per line. Please submit this file along with the other files.

You can turn in the assignment multiple times, but only the last version you submitted will be graded.