Question: E9.13 The java.awt.Rectangle class of the standard Java library does not supply a method to compute the area or perimeter of a rectangle. Provide a

 E9.13 The java.awt.Rectangle class of the standard Java library does notsupply a method to compute the area or perimeter of a rectangle.

E9.13 The java.awt.Rectangle class of the standard Java library does not supply a method to compute the area or perimeter of a rectangle. Provide a subclass BetterRectangle of the Rectangle class that has getPerimeter and getArea methods. Do not add any instance variables. In the constructor, call the setLocation and setSize methods of the Rectangle class. In E9_13 class, provide 3 test cases that tests the methods that you supplied printing expected and actual results. The test cases are: 1) One positive test case testing your method with valid inputs 2) Two negative test cases, testing your methods for invalid inputs and printing proper error message indicating proper error handling. Note: You must include documentation for your code including javadoc as defined in PA3-Appendix B. APPENDIX B Documentation and Javadoc Requirements 1. In every Java Application and class you should have enough header comments that will describe which assignment this is and who wrote the program. Thus, after any needed import statements your at the top under any imports statements you should put your program wide comments. 2. At the beginning of each method such as main(), you should have a short sentence describing the purpose of that method. Javadoc comments are always enclosed in /** and */ otherwise the Javadoc compiler will not find them. 3. As you get into programs with subordinate classes, you need to have header comments and again comments for each method. 4. Optionally, the @see comment is used to provide a links to other documents such as the original specification, the Java API for specific features, etc. For example, I may use the substring command in my code and I want to provide the reader with a link to the Java API: @see Java Substring method 5. Within a method you will need to put regular comments that are not caught by the Javadoc compiler but are useful in informing the reader on what is going on in this program. These comments are just preceded by two slashes: The purpose of the function is to accept a floating point number representing degrees Celsius and convert it into a floating point number representing degrees Fahrenheit. public float getF(float degC) { // declare variables float degF; // convert degrees C to degrees F degF - (degC * 1.8) + 32; return degF; } 6. Add Javadoc comments for EACH method in your class. Make sure that each method has an @param and @return Javadoc comment if they have parameters or return values. To get IntelliJ to make a template for you automatically, position your cursor above the method and type in /** then press enter. IntelliJ will build the template for your to fill in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!