메뉴 건너뛰기

Free Board

조회 수 5,219 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

가 위로 아래로 댓글로 가기 인쇄 첨부 쓰기 목록
?

단축키

Prev이전 문서

Next다음 문서

가 위로 아래로 댓글로 가기 인쇄 첨부 쓰기 목록
?
  • JaeSoo 2007.10.08 16:31

    GuGuLab.java

    class GuGuLab extends GuGu {


     public static void main(String[] args){
     GuGuDan gu;  
      if (args.length==1) {
       int dan=Integer.parseInt(args[0]);
       gu= new GuGu(dan);
       gu.printPart();
      } else if (args.length==2)
      {
        int dan=Integer.parseInt(args[0]);
        int num=Integer.parseInt(args[1]);
        gu= new GuGu(dan, num);
        gu.printPart();
      } else
       { 
        gu= new GuGu();
        gu.printAll();
       }


     }
    }



    GuGu.java

    class GuGu extends Multiplication {
     
     GuGu(){}
     
     GuGu(int dan){
     super(dan);
     }
     
     GuGu(int dan, int number){
     super(dan,number);
     }
     
     void printPart() {
      if (number == 0) {      
       System.out.println(dan+"단 : ");
       for(int n=1; n <= 9; n++){
        System.out.print(dan+ "X" +n+ "=" + (dan*n)+"t");
        System.out.println();  
      }
     }
     
     else  {
       System.out.println(dan + "X" +number+ "=" +(dan*number));
      }
     }


     
      void printAll(){
       for(int i=1; i<=9; i++){
        for(int j=1; j<=9; j++){
         System.out.println(i + "X" +j+ "=" +(i*j));
       }
       System.out.println();
      } 
     }
    }


    틀린 부분을 한번 잘 찾아보세요 ^^;


  1. [공지] 자유 게시판 입니다.

    Date2004.08.17 yoon Reply1 Views24,652
    Read More
  2. 교수님,질문이요~^ㅡ^

    Date2007.12.21 64도언 Views5,723
    Read More
  3. [re] 출석 만점자들은 성적 조정하겠습니다.

    Date2007.12.21 yoon Views23,787
    Read More
  4. 교수님

    Date2007.12.19 아아아아잉 Views6,148
    Read More
  5. 교수님

    Date2007.12.12 dal Reply1 Views7,379
    Read More
  6. 교수님,, 기말프로젝트 관련해서,,

    Date2007.12.12 doll Views6,780
    Read More
  7. [re] 교수님,, 기말프로젝트 관련해서,,

    Date2007.12.16 yoon Views7,239
    Read More
  8. 교수님 질문이요.

    Date2007.12.11 MIN Views6,956
    Read More
  9. [re] 교수님 질문이요.

    Date2007.12.16 yoon Views25,331
    Read More
  10. 교수님,,

    Date2007.12.10 쏭 Reply1 Views6,768
    Read More
  11. 아래내용해결됐는데

    Date2007.12.10 도렘 Reply1 Views25,647
    Read More
  12. 완전 급해요 ㅜ

    Date2007.12.10 도렘 Reply1 Views25,680
    Read More
  13. 교수님..

    Date2007.12.08 xhf Reply1 Views6,127
    Read More
  14. 처방전

    Date2007.12.08 1111 Views7,138
    Read More
  15. 교수님~! 궁금사항

    Date2007.12.07 쑴 Views6,315
    Read More
  16. [re] 교수님~! 궁금사항

    Date2007.12.08 yoon Views24,207
    Read More
  17. 교수님 ...

    Date2007.12.07 ★ 초코ㅅΙ럽 Views6,179
    Read More
  18. [re] 교수님 ...

    Date2007.12.08 yoon Views24,887
    Read More
  19. 교수님..

    Date2007.12.05 1111 Views5,976
    Read More
  20. [re] 교수님..

    Date2007.12.08 yoon Views25,352
    Read More
Board Pagination Prev 1 2 3 4 5 ... 6 Next
/ 6
위로