도형 넓이 구하기 썸네일형 리스트형 [JAVA] 도형 클래스를 객체를 생성하여 도형의 넓이를 구하는 프로그램 만들기 import java.util.Scanner; class Triangle{ double width=0; double height=0; double triangle_area() { return (width*height)/2; } } class Square{ int width=0; int height=0; int square_area() { return(width*height); } } class Circle{ double radius = 0; double circle_area() { return(radius*radius*3.14); } } public class Shape { public static void main(String[] args) { Scanner sc = new Scanner(System... 더보기 이전 1 다음