Tuesday, April 5, 2011

homework 9 documentation


Homework 9








Kaitlyn Monteer
MU ID: 005553861
5 April 2011

E8.1

Design document

Class
Purpose
Point
Container for program.

Program diagram

Developments steps

  1. Create new project called Point.
  2. Change program file name to Point.
  3. Change class declaration to Point instead of main.
  4. Right-click the Point file and select Reverse Engineer.
  5. Create new class diagram.
  6. Drag and drop the class option to the window.
  7. Change class name from Untitled to Point.
  8. Change the main method to public int manhattanDistance(Point other)
  9. Save the diagram and drag and drop it to the Point file.

Test results

Step
Expected Output
Actual Output
1
None
None
2
None
None
3
None
None
4
None
None
5
None
None
6
None
None
7
None
None
8
None
None
9
None
None

E8.13

Design document

Class
Purpose
Rectangle
Container for program.

Program diagram


Developments steps

  1. Create a new project called Rectangle.
  2. Change the java file name to Rectangle.
  3. Change the class declaration to Rectangle.
  4. Right-click the java file and select Reverse Engineer.
  5. Create a new class diagram for the Rectangle class.
  6. Drag and drop the class option to the window.
  7. Change the class name from Untitled to Rectangle.
  8. Change the main method to public Rectangle(int x, int y, int width, int height)
  9. Add the attributes int x, int y, int width, int height.
  10. Add the method public String toString().

Test results

Step
Expected Output
Actual Output
1
None
None
2
None
None
3
None
None
4
None
None
5
None
None
6
None
None
7
None
None
8
None
None
9
None
None
10
None
None

 



P8.1

Design document

Class
Purpose
RationalNumber
Container for program.

Program diagram

Developments steps

  1. Create new project called RationalNumber.
  2. Change file name from Main.java to RationalNumber.java.
  3. Change class declaration from Main to RationalNumber.
  4. Right-click the RationalNumber.java file and select Reverse Engineer.
  5. Create a new class diagram of RationalNumber.
  6. Drag and drop the class option to the window.
  7. Change the class name from Untitled to RationalNumber
  8. Change the main method to public RationalNumber(int numerator, int denominator).
  9. Add the attributes int numerator and int denominator.
  10. Add the method public String toString().

Test results

Step
Expected Output
Actual Output
1
None
None
2
None
None
3
None
None
4
None
None
5
None
None
6
None
None
7
None
None
8
None
None
9
None
None
10
None
None


References

Sun Microsystems. (2004). Scanner (Java 2 Platform SE 5.0). Sun Microsystems, Inc., Santa Clara, CA USA. [Online]. Available http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

No comments:

Post a Comment