compile got problem.

i got 1 error. but cant figure what is wrong after i compile. help me please. )=

import java.util.Scanner;

public class NumberCounter {

public static void main(String [] args){

Scanner sc = new Scanner(System.in);

final int MAX = 50;

final int MIN = 0;

int i = 0;

int user;

int counter=0;

int [] freq = new int [51];

System.out.println("Please enter integer between 0 and 50");

while(true){

if ((i < MIN) || (i >MAX)){

break;

}

if (( i >= MIN) && (i<=MAX)){

freq ++;

}

else

System.out.print("error in input" + " please enter another number.");

double integer = sc.nextDouble(); sc.nextLine ();

continue;

int integerInput = integerInput +1;

}

}

int numberOfIntegers = integerInput;

}

[891 byte] By [ms_kathya] at [2007-11-26 17:15:31]
# 1
> i got 1 error. but cant figure what is wrong after i> compile. help me please. )=> You should always post the exact, full error message in order to get good help here.
atmguya at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...
# 2
Also, use the code tags when posting code. (There's a code button right above the text box where you create your post.)
atmguya at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...
# 3
int integerInput = integerInput +1;What is this supposed to do?
CaptainMorgan08a at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...
# 4

import java.util.Scanner;

public class NumberCounter {

public static void main(String [] args){

Scanner sc = new Scanner(System.in);

final int MAX = 50;

final int MIN = 0;

int i = 0;

int user;

int counter=0;

int [] freq = new int [51];

System.out.println("Please enter integer between 0 and 50");

while(true){

if ((i < MIN) || (i >MAX)){

break;

}

if (( i >= MIN) && (i<=MAX)){

freq ++;

}

else

System.out.print("error in input" + " please enter another number.");

double integer = sc.nextDouble(); sc.nextLine ();

continue;

int integerInput = integerInput +1;

}

}

int numberOfIntegers = integerInput;

}

Message was edited by:

ms_kathy

ms_kathya at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...
# 5
NumberCounter.java:41: cannot find symbolsymbol : variable integerInputlocation: class NumberCounterint numberOfIntegers = integerInput;^1 error
ms_kathya at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...
# 6
It's because integerinput is out of scope.
CaptainMorgan08a at 2007-7-8 23:43:31 > top of Java-index,Developer Tools,Java Compiler...