Lab7

java1-lab7(updated)
Lab7 프로젝트 디렉토리 안에 모든 파일(src/*.java & bin/*.class)와 보고서 (2~3장)를 넣고 Lab7_학번_이름.zip 압축한 후 e-learning(http://lms.dankook.ac.kr/index.jsp)으로 제출 (Due by 5/28 연장)

Lab7 package & import & ArrayList & triangle classification & quadrilateral classification

도형의 점을 입력하여 삼각형/사각형 도형을 판별하고 도형의 면적과 둘레를 계산한다.

Lab7 프로젝트 디렉토리 안에 모든 파일(src/*.java & bin/*.class)와 보고서 (2~3장)를 넣고 Lab7_학번_이름.zip 압축한 후 e-learning(http://lms.dankook.ac.kr/index.jsp)으로 제출 (Due by 5/31 연장)

Lab7 package & import & ArrayList & triangle classification & quadrilateral classification

Triangle 클래스

-TriangleType classify()

-TriangleType classifyByAngle()

Quadrilateral 클래스

-QuadrilateralType classify()

-Quadrilateral 클래스의 area()

Lab7 클래스

-ArrayList<Figure> figureList
-그리고, 사용자가 도형의 점을 입력하여 삼각형/사각형 도형을 판별하고 도형의 면적과 둘레를 계산한다.

 

private static final Point[] triangle1 = { new Point(10, 0), new Point(0, 10), new Point(10, 10) };
private static final Point[] triangle2 = { new Point(5, 0), new Point(0, 10), new Point(10, 10) };
private static final Point[] triangle3 = { new Point(7, 0), new Point(0, 5), new Point(5, 5) };
private static final Point[] triangle4 = { new Point(5, 0), new Point(0, 10), new Point(5, 5) };
private static final Point[] triangle5 = { new Point(7, 0), new Point(0, 5), new Point(5, 10) };
private static final Point[] rectPoints1 = { new Point(0, 0), new Point(0, 20), new Point(30, 20), new Point(30, 0) };
private static final Point[] rectPoints2 = { new Point(10, 0), new Point(0, 10), new Point(20, 30), new Point(30, 20) };
private static final Point[] squarePoints1 = { new Point(0, 0), new Point(0, 20), new Point(20, 20), new Point(20, 0) };
private static final Point[] squarePoints2 = { new Point(0, 20), new Point(20, 40), new Point(40, 20), new Point(20, 0) };
private static final Point[] trapezoidPoints1 = { new Point(10, 0), new Point(0, 20), new Point(30, 20), new Point(20, 0) };
private static final Point[] trapezoidPoints2 = { new Point(0, 10), new Point(0, 30), new Point(10, 40), new Point(10, 0) };
private static final Point[] trapezoidPoints3 = { new Point(0, 10), new Point(20, 30), new Point(30, 20), new Point(20, 10) };
private static final Point[] trapezoidPoints4 = { new Point(0, 0), new Point(10, 30), new Point(30, 30), new Point(10, 0)};
private static final Point[] parPoints1 = { new Point(10, 0), new Point(0, 20), new Point(20, 20), new Point(30, 0) };
private static final Point[] parPoints2 = { new Point(10, 10), new Point(30, 10), new Point(20, 0), new Point(0, 0) };
private static final Point[] parPoints3 = { new Point(0, 10), new Point(20, 30), new Point(40, 20), new Point(20, 0) };
private static final Point[] rhombusPoints1 = { new Point(10, 0), new Point(0, 20), new Point(10, 40), new Point(20, 20) };
private static final Point[] rhombusPoints2 = { new Point(20, 0), new Point(0, 10), new Point(20, 20), new Point(40, 10) };
private static final Point[] kitePoints1 = { new Point(10, 0), new Point(0, 10), new Point(10, 40), new Point(20, 10)};
private static final Point[] kitePoints2 = { new Point(10, 0), new Point(0, 10), new Point(10, 20), new Point(40, 10)};