Can you tell me in this code because when I put a result between 1 and 10, it throws me to the% wrong% data%?
public static void main(String[] args) {
Scanner Scan = new Scanner(System.in);
//variables
int data, dia, any, cinturo, genere, mes;
int edat;
boolean tipusCorrecte;
boolean pesReal;
double pes;
edat = 0;
genere = 0;
cinturo = 0;
pes = 0;
any = 0;
mes = 0;
dia = 0;
int id = 0;
System.out.println("PRUEBA");
System.out.println("INTRODUCE ID:");
tipusCorrecte = Scan.hasNextInt();
if (tipusCorrecte) {
id = Scan.nextInt();
Scan.nextLine();
if ((id > 0) && (id < 10)) {
if ((edat > 4) && (edat < 17)) {
System.out.println("Introdueix edat:");
edat = Scan.nextInt();
Scan.nextLine();
} else {
System.out.println("dato incorrecte");
}
} else {
System.out.println("dato incorrecte");
}
} else {
System.out.println("dato incorrecte");
}
}
}