/*
import java.util.*;
public class Main {
String name;
int year;
int inch;
Main(String n, int y, int i) {
name=n;
year=y;
inch=i;
}
void show() {
System.out.printf(name+"에서 만든 "+year+"년형"+inch+"인치 TV");
}
public static void main(String[] args) {
Main myTV=new Main("LG",2017,32);
myTV.show();
}
}
*/
/*
import java.util.*;
class Grade{
int math;
int science;
int english;
Grade(int math,int science,int english)
{
this.math=math;
this.science=science;
this.english=english;
}
int average()
{
return (math+science+english)/3;
}
}
public class Main{
public static void main(String[] args) {
Scanner t=new Scanner(System.in);
System.out.printf("수학, 과학, 영어 순으로 3개의 점수 입력>>");
int math = t.nextInt();
int science = t.nextInt();
int english = t.nextInt();
Grade me = new Grade(math, science, english);
System.out.println("평균은 " + me.average());
}
}
*/
/*
import java.util.*;
class song{
String title;
String artist;
int year;
String country;
song(String title, String artist, int year, String country)
{
this.title=title;
this.artist=artist;
this.year=year;
this.country=country;
}
void show()
{
System.out.printf(year+"년 "+country+"국적의 "+artist+"가 부른 "+title);
}
}
public class Main{
public static void main(String[] args) {
song a= new song("Dancing Queen","ABBA",1987,"스웨덴");
a.show();
}
}
*/
/*
import java.util.*;
class rectangle{
int x;
int y;
int width;
int height;
rectangle(int x,int y,int width,int height){
this.x=x;
this.y=y;
this.width=width;
this.height=height;
}
int square(){
return(width*height);
}
void show() {
System.out.printf("(" +x+ "," +y+ ")" +"에서 크기가"+ width+"x"+height+"인 사각형");
}
boolean contains(rectangle r) {
}
public class Main{
public static void main(String[] args) {
rectangle r = new rectangle(2,2,8,7);
rectangle s = new rectangle(5,5,6,6);
rectangle t = new rectangle(1,1,10,10);
r.show();
System.out.println("s의 면적은 " + s.square());
if(t.contains(r)) {
System.out.println("t는 r을 포함합니다.");
}
if(t.contains(s)) {
System.out.println("t는 s을 포함합니다.");
}
}
}
*/
import java.util.*;
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+"입니다.");
}
}
class MonthSchedule{
Day[] d;
MonthSchedule (int n)
{
d=new Day[n];
for(int i=0;i<n;i++)
{
d[i]=new Day();
}
}
void run()
{
Scanner t=new Scanner(System.in);
System.out.println("이번달 스케쥴 관리 프로그램");
while(true)
{
System.out.print("할일(입력:1, 보기:2, 끝내기:3) >>");
int n = t.nextInt();
if(n==1) input();
else if(n==2) view();
else {
finish();
return ;
}
}
}
void input()
{
Scanner t=new Scanner(System.in);
System.out.print("날짜(1~30)?");
int day =t.nextInt();
System.out.print("할일(빈칸없이입력)?");
String w=t.next();
d[day].set(w);
}
void view()
{
Scanner t=new Scanner(System.in);
System.out.print("날짜(1~30)?");
int day =t.nextInt();
System.out.print(day+"일의 할 일은 ");
d[day].show();
}
void finish()
{
System.out.println("프로그램을 종료합니다.");
}
public static void main(String[] args) {
MonthSchedule april=new MonthSchedule(30);
april.run();
}
}