Description
Resources
– Eclipse Java IDE, BlueJ, or Grasp.
– Notepad++.
Marking Rubric
1. Program design correctness: [40%].
2. Proper comments and documentation: [10%]
a) Your code is required to be properly commented and necessary to have a header
section that shows the author, date, and the assignment number that it belongs to. It
further describes the purpose of the program.
b) In your code, use comments to explain the purpose of the declared variables and the
lines of your code.
3. Compilation: [20%] your code compiles without error.
4. Execution and output: [10%] your code is required to be executed without any crashes and the
program must produce the correct output.
5. Code appearance and appropriate indentation: [20%] your code must be properly formatted.
Matching pairs of {} are required to be in the same column with proper indentation. Lines in the
program are required to be uniformly indented and/or separated to enhance the readability.
Deliverables
– The assignment should be submitted by the due date using the Blackboard dropbox.
– Copies of the Java programs. (TriangleU2710.java and MyMain.java).
– UML diagram drawing file in docx, jpg, or pdf format
– The documentation file in docx or pdf format.
Question:
Assume that a class named as TriangleU2710 contains the following:
1. Six variables named coordX1, coordY1, coordX2, coordY2, coordX3, coordY3 with the
type double
2. Set and get methods,
3. A no-argument constructor that contains a default triangle with points coordinate (0,0,
2,2,4,4).
4. A Constructor that creates a triangle with the specified points coordinate.
5. A method named distance that returns the distance between two points
a) double distance (double x1, double y1, double x2, double y2)
6. A method named angleOfPoints that returns the angle between two points.
b) double angleOfPoints (double x1, double y1, double x2, double y2)
7. A method getArea() that returns the area of the triangle .
8. A method getPerimeter() that returns the perimeter of the triangle.
9. A method Isosceles() that returns true if the specified triangle has two sides equal.
10. A method Equilateral() that returns true if the specified triangle has all sides equal.
11. A method Scalene() that returns true if the specified triangle has all sides equal.
12. A method Right Triangle() that returns true if the specified triangle has all sides equal.
13. A method Acute() that returns true if the specified triangle has all sides equal.
14. A method Equiangular() that returns true if the specified triangle has all sides equal.
With the above information, do the following:
A. Create TriangleU2710.java to implement the class.
B. Write a test program (MyMain.class) that do the following:
a. Creates TriangleU2710 objects with points have the following coordinates
Point1 = (2.5,2)
Point3 = (4.2,3)
Point2 = (5,3.5)
b. Display the area and the perimeter of the triangle with the above coordinates.
c. Use different points coordinate to test you code for methods from 8-14.
C. Create documentation