전체 글

import java.util.Scanner; class Day{ private String work; public void set(String work) {this.work = work;} public String get() {return work;} public void show() { if(work == null) System.out.println("없습니다."); else System.out.println(work+"입니다."); } } public class MonthSchedule { private Scanner sc; private int daysNum; private Day [] days; public MonthSchedule(int d) { daysNum = d; this.days = n..
import java.util.Scanner; class Circle{ private double x,y; private int radius; public Circle (double x, double y, int radius) { this.x = x;this.y = y;this.radius = radius; } public void show() { System.out.println("가장 면적이 큰 원은 ("+x+","+y+")"+radius); } //원의 넓이 리턴 public double circle() { return radius*radius*3.14; } } public class CircleManager { public static void main(String[] args) { // TODO..
import java.util.Scanner; class Circle{ private double x,y; private int radius; public Circle (double x, double y, int radius) { this.x = x;this.y = y;this.radius = radius; } public void show() { System.out.println("("+x+","+y+")"+radius); } } public class CircleManager { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.in); Circle ..
public class Rectangle { private int x,y,width,height; //생성자 public Rectangle(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } //사각형 넓이 리턴 public int square() { return width*height; } //사각형의 좌표와 넓이를 화면에 출력 void show() { System.out.println("("+x+","+y+")에서 크기가 "+width+"x"+height+"인 사각형"); } //매개변수로 받은 r이 현 사각형 안에 있으면 리턴 boolean contains(Re..
public class Song { private String title; private String artist; private int year; private String country; public Song() {} public Song(int year,String country,String artist,String title) { this.year = year; this.country = country; this.artist = artist; this.title = title; } void show() { System.out.println(year+"년 "+country+"국적의 "+artist+"가 부른 "+title); } public static void main(String[] args) ..
import java.util.Scanner; public class Grade { private int math; private int science; private int english; public Grade(int math, int science, int english) { this.math = math; this.science = science; this.english = english; } public int average() { return (math+science+english)/3; } public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner = new Scanner(System.i..
예림의 코딩
예림의 코딩