디시인사이드 갤러리

갤러리 이슈박스, 최근방문 갤러리

갤러리 본문 영역

자바 컴파일 에러좀 봐주세요

아씨발꿈(220.87) 2011.03.25 16:06:34
조회 138 추천 0 댓글 9

나 지금 이거 하는데 장장 10시간이 넘게 고민하고 사투하고있다. 여기에다 이거 올려도 욕만 먹겠지만, 지식인도 답변이없다.
지푸라기라도 잡는 심정이니까 조금 봐줘..(나 지금 자살할 위기다 시발)



계속 컴파일 에러가 나네.

---------- javac ----------
ScoreManager.java:76: cannot find symbol
symbol  : variable no
location: class ScoreManager
  st.no = no+1;
          ^
ScoreManager.java:76: incompatible types
found   : <nulltype>
required: int
  st.no = no+1;
            ^
ScoreManager.java:85: cannot find symbol
symbol  : variable arraySize
location: class ScoreManager
   System.out.print("몇 반 학생을 추가합니까<1~" +arraySize+"> >>");
                                        ^
ScoreManager.java:86: cannot find symbol
symbol  : variable sc
location: class ScoreManager
      st.classNum = sc.nextInt();
                    ^
ScoreManager.java:88: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   sc.reset();
   ^
ScoreManager.java:89: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   st.name = sc.next();
             ^
ScoreManager.java:90: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   sc.reset();
   ^
ScoreManager.java:92: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   st.kor = sc.nextInt();
            ^
ScoreManager.java:94: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   st.eng = sc.nextInt();
            ^
ScoreManager.java:96: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   st.mat = sc.nextInt();
            ^
ScoreManager.java:99: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   sc.nextLine();
   ^
ScoreManager.java:107: cannot find symbol
symbol  : variable classRoom
location: class ScoreManager
  classRoom[no++] = st;  
  ^
ScoreManager.java:107: cannot find symbol
symbol  : variable no
location: class ScoreManager
  classRoom[no++] = st;  
            ^
ScoreManager.java:120: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   menu = sc.nextInt();
          ^
ScoreManager.java:123: cannot find symbol
symbol  : variable sc
location: class ScoreManager
   sc.nextLine();   
   ^
ScoreManager.java:134: cannot find symbol
symbol  : variable classRoom
location: class ScoreManager
   if(classRoom[i]==null) break;
      ^
ScoreManager.java:135: cannot find symbol
symbol  : variable classRoom
location: class ScoreManager
   Student st = classRoom[i];
                ^
17 errors

출력 완료 (1초 경과) - 정상 종료


----------------------------------------- 나 책, 지식인 존나 검색했는데 모르겠다. 내가 알기론 cannot find symbol이 선언되지 않은 것을 쓰려고 해서 뜨는거라는데.. 분명 Student 객체를 만들어서 사용하는데 왜 안되냐. 진짜.. 이거 말고 이전버전 소스가 거의 흡사해서 그걸토대로 만들었는데 그것은 거의 유사한데 잘 돌아간다는 것이다. 아우 죽겠다. 진자..
import java.util.*;

public class ScoreManager {
 
 
    int classes[];

 
 
 public static void main(String[] args) {
   
      Scanner sc = new Scanner(System.in);
      boolean bContinue=true;
   Student[] classRoom;
  
   
   classRoom = new Student[10];
  
      ScoreManager a = new ScoreManager();
      a.showTitle();
  

 

  
   Scanner scan = new Scanner(System.in);
   int[] classes = null;
   int arraySize = 0;

   System.out.print("몇개의 학급을 생성하시겠습니까?");
   arraySize = scan.nextInt();
   System.out.print( arraySize+"개의 학급이 생성되었습니다.");
      classes = new int[arraySize];
     
  

      while(bContinue){
   
   int menu = a.showMenu();
   
   switch(menu){
   case 0:
    System.out.println("프로그램을 종료합니다....");
    bContinue=false;
    break;
   case 1:
    a.inputStudent();
    break;
   case 2:
    a.showScoreTable();
    break;
   default:
    System.out.println("메뉴는 (0-2) 사이의 값만 선택가능합니다.");
    break;
   }
  }
  


 }


     public void showTitle() {
  System.out.println();
  System.out.println("==========================================");
  System.out.println("=            성적 관리 프로그램          =");
  System.out.println("=                              ver 0.2   =");
  System.out.println("=                        created by JI   =");
  System.out.println("=   설명: 성적을 반별로 관리 가능        =");
  System.out.println("==========================================");
  
 }

       private void inputStudent() {
  Student st = new Student();
  st.no = no+1;
       
 
  
  

  System.out.println("======성적 입력=====");
  try{
   
   System.out.print("몇 반 학생을 추가합니까<1~" +arraySize+"> >>");
      st.classNum = sc.nextInt();
   System.out.print(+st.classNum+"반"+st.no+"번 학생 이름 = ");
   sc.reset();
   st.name = sc.next();
   sc.reset();
   System.out.print("국어 = ");
   st.kor = sc.nextInt();
   System.out.print("영어 = ");
   st.eng = sc.nextInt();
   System.out.print("수학 = ");
   st.mat = sc.nextInt();
  } catch (Exception e){
   System.out.println("잘못된 정보 입력으로 메뉴로 돌아갑니다.");
   sc.nextLine();
   return;
  }
  
  // 총점, 석차 계산
  st.calcTot();
  st.calcAvg();
  
  classRoom[no++] = st;  
 }

       public int showMenu() {
  int menu=-1;
  System.out.println();
  System.out.println("===================메 뉴===================");
  System.out.println("0 : 프로그램 종료");
  System.out.println("1 : 성적 입력");
  System.out.println("2 : 성적 출력");
  System.out.println("===========================================");
  System.out.print("선택 >> ");
  try{
   menu = sc.nextInt();
  } catch (Exception e){
   System.out.println("숫자만 입력 가능합니다.");
   sc.nextLine();   
  }
  return menu;
    }

    private void showScoreTable() {
  System.out.println();
  System.out.println("=================성적 처리 결과========================");
  System.out.println("번호\\t이름\\t국어\\t영어\\t수학\\t총점\\t평균");
  System.out.println("=======================================================");
  for(int i=0; i<10; i++){
   if(classRoom[i]==null) break;
   Student st = classRoom[i];
   System.out.println(st.no+"\\t"+st.name+"\\t"+st.kor+"\\t"+st.eng+"\\t"+st.mat+"\\t"+st.tot+"\\t"+st.avg);
  }
  System.out.println("=======================================================");
  
 }
}



이거에 클래스 하나더



public class Student {
 public int classNum;
 public String name;
 public int no;
 public int kor;
 public int eng;
 public int mat;
 public int tot;
 public double avg;
 public int grade;
 public int classRank;
 public int totalRank;
 
 public void calcTot(){
  tot = kor+eng+mat;  
 }
 
 public void calcAvg(){
  avg = tot/3;
 }

 public void calcGrade(){
  
 }

 public void printStudent(){
  
 }
 
}

추천 비추천

0

고정닉 0

0

댓글 영역

전체 댓글 0
등록순정렬 기준선택
본문 보기

하단 갤러리 리스트 영역

왼쪽 컨텐츠 영역

갤러리 리스트 영역

갤러리 리스트
번호 제목 글쓴이 작성일 조회 추천
설문 이혼하고 나서 더 잘 사는 것 같은 스타는? 운영자 24/07/08 - -
242151 노트패드++가 에디트플러스에 비하면 훨씬좋네 [2] ㅈㄷ(211.208) 11.04.04 134 0
242150 뭔 게이들이 판을치냐.. [1] 좌절중인SOD갤로그로 이동합니다. 11.04.04 50 0
242149 아스횽은 봅니다 [1] 자취생੦ܫ੦갤로그로 이동합니다. 11.04.04 49 0
242148 역시... [4] Adelposs갤로그로 이동합니다. 11.04.04 73 0
242147 안영 프갤 성님들 [1] Adelposs갤로그로 이동합니다. 11.04.04 69 0
242146 형들 근데 면접가면 보통 어떤거 물어봄? [4] ㅎㅎㅎㅎㅎ(220.149) 11.04.04 123 0
242145 ajax [1] ㅁㄴㅇ(210.178) 11.04.04 61 0
242143 리눅스 설치에 대해서 질문좀 할게.. [4] 오지명의후예갤로그로 이동합니다. 11.04.04 91 0
242142 BNC 커넥터 (일명 티비 연결 커넥터) 같은거 보통 어디팜? [4] 123(125.7) 11.04.04 336 0
242141 질문은 구글 [5] 킁킁이(121.66) 11.04.04 77 0
242140 컹컹이(121.66) 11.04.04 29 0
242139 킁킁이(121.66) 11.04.04 26 0
242138 컹컹이(121.66) 11.04.04 33 0
242137 킁킁이(121.66) 11.04.04 33 0
242136 답 좀 알려줘 형들! [1] PHENA갤로그로 이동합니다. 11.04.04 64 0
242135 dd Java String 수 세는거 봐.. 미라발칸갤로그로 이동합니다. 11.04.04 66 0
242134 c++ 뭐가 잘못된건지.. [3] 까만천사s갤로그로 이동합니다. 11.04.04 82 0
242133 횽들 질문 하나만 할게요 ㅠㅠ 오토마타ㄳ(125.184) 11.04.04 65 0
242132 dd 오류건 하나더... [1] 미라발칸갤로그로 이동합니다. 11.04.04 51 0
242131 밑에 dd Java 오류 나는 건 봐.. [1] 미라발칸갤로그로 이동합니다. 11.04.04 56 0
242130 아.. 안자는 횽들 있어? 자바 오류좀 ㅜㅜ dd(119.70) 11.04.04 60 0
242129 플밍 너무너무 재미있지 않아? [1] 어떡해갤로그로 이동합니다. 11.04.04 96 0
242128 c++ 질문이랑께 [2] tri_angle갤로그로 이동합니다. 11.04.04 75 0
242127 4입력 NAND 게이트 출력이 항상 HIGH 일수 있어? [3] 6시내고환(124.28) 11.04.04 351 0
242126 백수되고 올만에 프갤왔는데, 물갈이 많이 되었네... [3] 외계달팽갤로그로 이동합니다. 11.04.04 120 0
242125 함수 호출에 대해서 궁금한게 있어요 헬프 ㅠㅠㅠㅠ 횽들 ㅠㅠㅠ [2] 칰칰이갤로그로 이동합니다. 11.04.04 60 0
242124 컹...안돌아가넹 다시 도와주실분.. [3] ㅁㅁㅁ(121.141) 11.04.04 55 0
242123 데이터 송수신 제어신호인 DT/R 신호가 뭔지 아는사람 있어? 6시내고환(124.28) 11.04.04 833 0
242122 으헝 빡쳐 이 오류 왜 나는지 좀 알려주세요 ㅠㅠ [6] 으헝헝(183.106) 11.04.04 106 0
242121 뇌자알 보는데 스택으로 사칙연산 프로그램만드는거 존나어렵네 11(121.172) 11.04.04 92 0
242120 횽들 이거 여기써도 될지 모르겠지만 한번만 보고 도와주세요 (피피티 관련 [5] lik(175.211) 11.04.04 88 0
242119 드림위버 말고 html5 웹디자인용으로 지원하는 프로그램 없음? カミ갤로그로 이동합니다. 11.04.04 156 0
242118 언어 공부하는 순서가 있나요?? [1] 펄사블갤로그로 이동합니다. 11.04.04 354 0
242116 나 진짜 퇴갤함 [1] Adelposs갤로그로 이동합니다. 11.04.04 52 0
242115 머리가 회전이 안되요 ㅜㅜ... 이거 어떻게 해야 할까요? [16] ㅇㅁㅇ(125.208) 11.04.04 196 0
242114 공용체는 어디에 쓰는거야? (59.25) 11.04.04 52 0
242112 ㅁㅁㅁㅁㅁㅁㅁㅁ 이거면 된거임? [3] Adelposs갤로그로 이동합니다. 11.04.04 54 0
242110 Adelposs 형 잘못올렷어; [5] ㅁㅁㅁ(121.141) 11.04.04 59 0
242109 이번엔 또 뭐가 잘못된걸까요 ㅜㅜㅜ [4] ㅇㅁㅇ(125.208) 11.04.04 66 0
242108 나 오브젝트 c공부하러 퇴갤할께요 Adelposs갤로그로 이동합니다. 11.04.04 73 0
242107 형들 질문좀 ㅇiny갤로그로 이동합니다. 11.04.04 72 0
242106 c++ 은 덤이구나. [1] jvm(125.183) 11.04.04 97 0
242105 씨인데....오류 좀 봐주실래여? 컴파일링은 0인데 ㅇㅇ(175.195) 11.04.04 65 0
242104 이거 뭐가 틀렷나여?? [3] ㅇㅁㅇ(125.208) 11.04.04 81 0
242103 으하하하야 이거 다해줌 이거면 됨 Adelposs갤로그로 이동합니다. 11.04.04 83 0
242102 살려줘 [2] PHENA갤로그로 이동합니다. 11.04.04 44 0
242100 안드로이드 진영에 디씨앱이 있다는 게 좃트루? [1] 분당살람갤로그로 이동합니다. 11.04.04 79 0
242099 C..디버깅하는데 이런 오류가 계속 떠요.ㅠ.ㅠ [3] RRR(175.195) 11.04.04 53 0
242098 Adelposs 횽 [2] 흐아아아아아(211.107) 11.04.04 65 0
242096 왜 저는 아무도 도와주지 않는건가요... [4] 면갤저격수갤로그로 이동합니다. 11.04.04 257 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2