1. Eclipse Debugger
-
Create a new Java Project in your Eclipse IDE.
-
Add the code from the Lab2 repo to your newly created Java Project.
The course staff will do a "show and tell" using the Eclipse Debugger.
2. Itemizations
The code that you have donwloaded from Lab2 repo
The clients of our shape library would like the following extensions.
-
All shapes should also have a color. The color is going to be given as an RGB number (8-bit notation). The RGB notation that we would like to use is made of of 3 numbers each number ranges from 0 to 255, e.g. The color white is represented as (255,255,255) the color black is represented as (0,0,0). You can use this website to play around with RGB codes and colors.
-
All shapes must be able to return their RGB code when called to do so.
-
Given a shape with an existing color, we should be able to provide a new color and obtain a new shape identical to the original but with its color updated to our new color.
-
All shapes should also support a shade mode that is one of two statee, shaded or unshaded. We should be able to get the current shade mode of a shape as well alter the mode in the same manner as in the case of color.
3. Adding new items in an Itemization
The clients are now requesting that our shape library deals with right angle triangles. The pin on a right angle triangle is on the corner of the triangle that has the right-angle. To create a triangle we will need to pass
-
the location of the pin,
-
the triangle’s base and
-
the triangle’s height
We would like the library to calculate the hypotenuse of the right-angle triangle. Given a right angle triangle we should be able to obtain
-
it’s base
-
it’s height
-
it’s pin
-
it’s hypotenuse
We also expect the right angle triangle to behave correctly for each shape operation that we have already discussed and is implemented for the existing shapes (i.e., circle, rectangle and square).
4. Adding more behaviour
The clients would like to replace one shape for another if the shape to be replaced takes up the same area as the shape to be replaced with.
They would also like to be able to test if the area of one shape is greater than the area of another shape, as well as, test if the area of one shape is less than the area of another shape.
5. Composite Shapes
The clients would now like to pair shapes up. The would like a composite shape that is made up of two other shapes. The two shapes can be any valid shape, e.g., two squares, a circle and a triangle etc.
The clients would like to treat this new composite shape just like any other regular shape and support all the operations of shapes that we already have agreed upon.