자바 프로그래밍 해결해주실분 ㅜㅜ

자바 프로그래밍 해결해주실분 ㅜㅜ

작성일 2024.05.06댓글 1건
    게시물 수정 , 삭제는 로그인 필요

profile_image 익명 작성일 -

안녕하세요.

코드 작성해서 올려드려요.

package abc.tt.tt; class Shape{ protected String name; protected int x, y; public Shape(String name, int x, int y) { this.name = name; this.x = x; this.y = y; } public Shape() { this("도형",0,0); } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public void ShowInfo(){ System.out.println("===== 정보출력 ==================="); System.out.println("이름: "+name); System.out.println("좌표(2D): "+x+", "+y); } } class Circle extends Shape{ protected int radius; public Circle(String name, int x, int y, int radius) { super(name, x, y); this.radius = radius; } public int getRadius() { return radius; } public void setRadius(int radius) { this.radius = radius; } public void ShowDetailInfo2D() { ShowInfo(); System.out.println("반지름: "+radius); } } class Rectangle extends Shape{ protected int width, height; public Rectangle(String name, int x, int y, int width, int height) { super(name, x, y); this.width = width; this.height = height; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public void ShowDetailInfo2D() { ShowInfo(); System.out.println("너비, 높이: "+width+", "+height); } } class Sphere extends Circle{ protected int z; public Sphere(String name, int x, int y, int z, int radius) { super(name, x, y, radius); this.z = z; } public int getZ() { return z; } public void setZ(int z) { this.z = z; } public void ShowDetailInfo3D() { ShowDetailInfo2D(); System.out.println("좌표(z축): "+z); } } class Box extends Rectangle{ protected int z, depth; public Box() { this("육면체",0,0,0,1,1,1); } public Box(String name, int x, int y, int z, int width, int height, int depth) { super(name, x, y, width, height); this.z = z; this.depth = depth; } public int getZ() { return z; } public void setZ(int z) { this.z = z; } public int getDepth() { return depth; } public void setDepth(int depth) { this.depth = depth; } public void ShowDetailInfo3D() { ShowDetailInfo2D(); System.out.println("좌표(z축): "+z); System.out.println("깊이: "+depth); } } public class ShapeTest { public static void main(String[] args) { Shape sh_obj = new Shape(); sh_obj.ShowInfo(); Circle c_obj2 = new Circle("동전",5,3,4); c_obj2.ShowDetailInfo2D(); Rectangle r_obj = new Rectangle("타일",7,5,11,13); r_obj.ShowDetailInfo2D(); Sphere s_obj = new Sphere("공",9,9,5,8); s_obj.ShowDetailInfo3D(); Box b_obj1 = new Box(); b_obj1.ShowDetailInfo3D(); Box b_obj2 = new Box("책",1,3,7,7,13,11); b_obj2.ShowDetailInfo3D(); } }

대해 질문&분석, 해결방법 도와주실 분

... 고령화 시대에 관해 시간적, 윤리적, 사회적, 공간적 관점으로 질문, 분석&해결 방법 만들어 주실 분 구합니다ㅜㅜ 고령화 문제에 대해 질문&분석, 해결방법 도와주실 분ㅜ...

영어 문법 문제 해결해주실 분 ㅜㅜ

Fertility rates fall when women are free to determine if they have children on their own. 여기서 어색한 부분을 수정하라는데 올바른 답과 이유도 부탁드리겠습니다ㅠㅠ...

친구 프사 초성 해결해주실분 ㅜㅜ

뭐죠? 혹시 저일까봐 겁나요 ㅜㅜ ㅇㅁ 미안해 나도 사람이라서 ~~~~ 미안해 그리고 사랑해 이런 내용이 있는걸로 봐서는 욕하거나 좋지 않은 내용은 아닌 것 같아요!

문제 시원하게 해결해주실 분

... 모르겠어요...ㅜㅜ 혹시 실력 있는 변호사 알고 계신다면 알려주세요! 아무래도... 시원한 해결책을 제시합니다. 익산이혼전문변호사라는 이름이 모자라지 않게 이혼을...