Study 오늘 수업 문제 풀이(학생 관리) bslime 2008. 5. 31. 15:36 class Student { private String name; private int num; private String hakgwa; private int haknyun; private int score; Student(String name, int num, String hakgwa, int haknyun, int score){ this.name = name; this.num = num; this.hakgwa = hakgwa; this.haknyun = haknyun; this.score = score; System.out.println("학생 이름 : " + this.name); System.out.println("학번 : " + this.num); System.out.println("학과 : " + this.hakgwa); System.out.println("학년 : " + this.haknyun); System.out.println("이수학점 : " + this.score); } } class Hakbu extends Student { private String dongari; Hakbu(String name, int num, String hakgwa, int haknyun, int score, String dongari){ super(name, num, hakgwa, haknyun, score); this.dongari = dongari; System.out.println("동아리 이름 : " + this.dongari); } } class Hakone extends Student { private String jogyo; private double janghak; Hakone(String name, int num, String hakgwa, int haknyun, int score, String jogyo, double janghak){ super(name, num, hakgwa, haknyun, score); this.jogyo = jogyo; this.janghak = janghak; System.out.println("조교유형 : " + this.jogyo); System.out.println("장학금 비율 : " + this.janghak); } } class Result { public static void main(String args[]) { Student stu1 = new Student("세리", 9024729, "체육", 4, 135); System.out.println(); Hakbu stu2 = new Hakbu("지은", 9320985, "체육", 1, 18, "골프"); System.out.println(); Hakone stu3 = new Hakone("경주", 8014832, "체육", 2, 24, "강의조교", 1.0); } }