11A

Write methods:

public static double perimeter(Rectangle r)
public static double area(Rectangle r)

that calculates the perimeter and area of the Rectangle r. Add these methods to the class Geometry.

Now complete the application called StaticTester. Call the methods with the given Rectangle as a parameter and print the results. Do not instantiate a Geometry object. You will receive no credit if you do so.

For the draft, implement the methods as stubs returning 0 and provide javadoc. There is no tester for the draft. Netbrat will only tell you that your code complies and has the correct name. You will upload one class, Geometry for the draft

For the final, you will upload both Geometry and StaticTester classes. Again NetBrat will not tell you if your code is correct. You have to decide yourself. You will just use the link to get the tester.

11A draft: http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=1304161914688843287580061929
11A final: http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=1304161914688843287580061929&level=2

11B

Section 9.1 explains the Question class and question hierarchy. For this problem you will add a FillInQuestion to the hierarchy. Such a question is constructed with a string that contains the answer, surrounded by _ _, for example, for the question:
"The inventor of Java was _James Gosling_". The question should be displayed as
     The inventor of Java was _____ (Use 5 underscores for the answer blank)

You will need to add the Question class to your project. Then leave it alone and do not make any changes to it.

For the draft: provide a class with the proper class header

11B draft: http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=13041616301756415221811928188
11B final: http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=13041616301756415221811928188&level=2

11C

The java.awt.Rectangle class of the standard Java library is rather boring. It does not have any color. Provide a subclass ColoredRectangle of the Rectangle class that has a Color instance variable. Provide methods to set and get the color. Do not add any instance variables except the Color. You will get no credit if you do. Provide a default constructor and a constructor that takes the x, y coordinate of the upper left-hand corner and the width and the height as ints and a Color object..

For the draft, implement the default constructor. The default constructor sets the color to black.

11C draft: http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=1304162159539923194965275352
11C final http://cs12.cs.sjsu.edu:8080/netbrat/files?repo=ext&problem=1304162159539923194965275352&level=2