메뉴 건너뛰기

Free Board

조회 수 4,197 추천 수 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 Views23,593
    Read More
  2. 교수님,질문이요~^ㅡ^

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

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

    Date2007.12.19 아아아아잉 Views4,965
    Read More
  5. 교수님

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

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

    Date2007.12.16 yoon Views5,727
    Read More
  8. 교수님 질문이요.

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

    Date2007.12.16 yoon Views24,223
    Read More
  10. 교수님,,

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

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

    Date2007.12.10 도렘 Reply1 Views24,027
    Read More
  13. 교수님..

    Date2007.12.08 xhf Reply1 Views4,913
    Read More
  14. 처방전

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

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

    Date2007.12.08 yoon Views23,108
    Read More
  17. 교수님 ...

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

    Date2007.12.08 yoon Views23,569
    Read More
  19. 교수님..

    Date2007.12.05 1111 Views4,859
    Read More
  20. [re] 교수님..

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